BEM and CSS Nesting #307
|
On the homepage of BEM there is currently the following CSS example: How/where can I use this example? Can the classes only be concatenated with a CSS pre processor (".opinions_box" + "__view-more" = ".opinions_box__view-more")? I expected it to work with CSS Nesting as well (also see Chrome Developers) but this is not working. Thank you very much for your help. |
Answered by
medienbaecker
Jun 16, 2023
Replies: 1 comment
|
It is indeed not possible with native CSS nesting. See https://www.w3.org/TR/css-nesting-1/#conditionals:~:text=Some%20CSS%2Dgenerating%20tools%20that%20preprocess%20nesting%20will%20concatenate%20selectors%20as%20strings%2C. So as far as I know you'll have to use a CSS preprocessor like Sass for BEM. |
0 replies
Answer selected by
josch87
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It is indeed not possible with native CSS nesting. See https://www.w3.org/TR/css-nesting-1/#conditionals:~:text=Some%20CSS%2Dgenerating%20tools%20that%20preprocess%20nesting%20will%20concatenate%20selectors%20as%20strings%2C.
So as far as I know you'll have to use a CSS preprocessor like Sass for BEM.