-
Notifications
You must be signed in to change notification settings - Fork 469
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BEM lint should allow block's/element's boolean modifier in shorthand. #419
Comments
Hey @christophercochran, It sounds like you are trying to use the Others have been tripped up by this as well, so we may call greater attention to this by renaming |
@sds From my understanding hyphenated_BEM is for writing BEM like classes like: where the modifier is delimited by a '--' (double hyphen) instead of '_' (single underscore). block-name_mod is following BEM naming convention set by BEM (https://github.com/bem/bem-naming/blob/master/README.md) and would use a single underscore instead of the double hyphen, so should still be within the convention of BEM and not hyphenated_BEM. block-name_modifier_value are currently allowed, but sometimes it is simpler to just write block-name_mod. Unless I am wrong and block-name_mod is not allowed, but in the link above it seems that it should be. |
It seems like your understanding is correct. Unfortunately, our team does not use The original regex was provided by @mrpavlikov in #254 (comment), who I believe is also using @christophercochran if you provide me a modified regex that matches the cases you expect and include some tests, I would happily merge a pull request. Thanks! |
Hello everyone!
Yes, correct, only key-value pair, like when you are writing css you write which property will have which value. Same goes for modifiers, you say what will be modified and which way. Check this out: https://en.bem.info/method/definitions/#modifiers-for-blocks
|
@mrpavlikov Thank you for your explanation. I saw one mention of boolean statements, but now that I think of it, in the world of CSS, these would be few anyways, and having the name and value does give more detail into what the modification is. Thank you again! |
Hi, I wouldnt consider myself a BEM expert, and fairly new to using it, but currently the BEM lint only allows block's/element's boolean modifier in key-value format.
For example:
block-name_mod-name_mod-val // allowed
block-name_mod // not
block-name__elem-name_mod-name_mod-val // allowed
block-name__elem_mod // not
Shouldn't block-name_mod and block-name__elem_mod be allowed? Or in writing BEM when using a modifier shouldn't it always be in key-value format?
The text was updated successfully, but these errors were encountered: