Fylo data storage component using Sass and BEM
Design comparison
Solution retrospective
First submission. Since this is a simple self contained component I built using BEM methodology. Would love feedback to see if on right track with BEM approach
Community feedback
- @shashiloPosted over 4 years ago
Great seeing you using BEM. Most people just go straight into using what they feel is best for class naming. It's tricky, but here's my feedback.
True BEM is only 1 level deep. For instance,
.storage
can have.storage__logo
as its element. But you should not use.Storage__progress_bar_container
is a really long name. I would rename this to.progress-bar__container
. Then.progress-bar
would be the parent that wraps all it's elements together. Another thing is to use lowercase first letter class names. I guess this is more of a preference than a must. I'm on the Slack channel if you need more info on this. http://getbem.com/naming/1@foolishsailorPosted over 4 years ago@shashilo THanks for taking the time to offer feedback!
Im using the naming conventions found here: BEM with React - Which is why the Block names were Pascal Case instead of camel case. Also you cant use dashes in class names in react only underscores.
Agree with the changing the progress bar to be its own block - but then I wonder should you not also make the two separate elements: control and meter - also blocks? SInce they would likely be separate components in react...
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord