Closed randombitsUK closed 9 years ago
Single hyphens are perfectly fine for naming things. For example:
.my-block__my-element--my-modifier {
...
}
Are underscores OK to use? If so a scsslint config file with that option turned on would be :astonished:
No, except when you double them with BEM. Sounds like you need to write your own linter. :dancer:
WILSON! :angry:
i've figured it out but i'm not telling you how
Your PRs :eyes:
i'm gonna use invisible ink in all my prs from now on
Why is this closed?
The point is was making is the styleguide implies you should only use single hyphens: "Use single hyphens as word separators in classes and variables"
BEM uses double dashes for the modifier in the class name. So surely the styleguide should simply say: "Use hyphens as word separators in classes and variables"
No, this refers to words and variables names, which are single hyphens. The BEM part is different. It's closed because in my opinion it's not worth the time discussing it further.
I read this as: "Use hyphens for separating words within a class name, instead of camel-case or underscores."
I don't read it as saying "you can only use single hyphens" or "this is the only way you can use hyphens." That would indeed go against the BEM naming scheme.
"Use single hyphens as word separators in classes and variables, to match the property naming scheme."
If using BEM we'll have double dashes for the modifier part?