what should be the naming class for various font style and variant BEM #248
Replies: 3 comments
-
You shouldn't have separate styles for each font style. Don't use class to provide single style. If you want a specific element to have italic font, just add
This keeps the style attached to the component, which makes it more flexible, reusable and safer to maintain. |
Beta Was this translation helpful? Give feedback.
-
I need separate style for the need of my project. |
Beta Was this translation helpful? Give feedback.
-
I'm sure there's a different way to achieve what you need, without classes like these. I assume you need these because you handle this with JS somehow, so maybe consider using attributes selectors? For example |
Beta Was this translation helpful? Give feedback.
-
I am reading this BEM and tried to apply in my project which using less and Bootstrap v3. I have tried to set class name for font setting in BEM but it doesn't look valid to me. something I am missing to understand.
here is the relevant less file
so my question is
what shoud be name
font__normal--bold or font__bold--normal or font__bold-normal ?
Please suggest
Beta Was this translation helpful? Give feedback.
All reactions