-
Notifications
You must be signed in to change notification settings - Fork 175
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
About nested components #2
Comments
.bar can be inside .foo-1 or .foo-2 and may have different properties. Is not the same element.
|
Indeed that's true: https://github.com/rstacruz/rscss#bleeding-through-nested-components You may need to use the child selector ( actually on that note, it might be a good idea to recommend |
In advance we don't know about nested case, so components are't independent. We are limited by element nesting level in HTML, if we write |
Avoid rule nesting at all costs, that's where BEM shines. |
Your structure does't work when we have nested components with same elements names.
In this case selector .foo-1 .bar affects on "bar" element of "foo-2" component
In BEM it's fine
The text was updated successfully, but these errors were encountered: