Comments (3)
It's not a good idea to have elements create their own block scopes in general. BEM really shines when elements are "portable", meaning that you can move them around and change their nesting without modifying the styles.
But an important BEM concept is to allow for the same tag to be an element of a block and its own block root:
<div class="my-big-component">
<div class="my-big-component__submit-control special-button">
<div class="special-button__label"></div>
<div class="special-button__other-label"></div>
</div>
</div>
from bemto.
But for now we already can make this:
+b.some-block
+b.scoped-elt.__element
+e.sub-element
And we will get:
<div class="some-block">
<div class="scoped-elt some-block__element">
<span class="scoped-elt__sub-element"
from bemto.
The basics for this was made in rc-1.0 using a special option and a syntax for making an element to be a root of the following elements:
- set_bemto_settings({ flat_elements: false })
+b.foo
+e.bar__
+e.taz
producing
<div class="foo">
<div class="foo__bar">
<div class="foo__bar__taz">
</div>
</div>
</div>
There are still some cases for elements of elements left, but they'll be implemented in later versions.
from bemto.
Related Issues (20)
- codepen.io HOT 1
- Ability to turn off inline element detection and context HOT 2
- Mixin to place element and set context at the same time HOT 5
- SUIT CSS support HOT 2
- Prefix shouldn't be added to non-first blocks HOT 1
- Форматировать отступ в выхлопе HOT 3
- How add custom class to element without block prefix? HOT 1
- Pug support any time soon? HOT 7
- Add setting for delimiter of class names. HOT 5
- Можно ли как-то получить наследование имени блока на уровень выше? HOT 3
- Перевод bemto в pug HOT 2
- Incorrect tag generator for href elements HOT 1
- Pug unbuffered code don't includes HOT 2
- bemto with JSX HOT 1
- How to make a bemto and webpack ?
- How to disable automatic attributes? HOT 1
- v-bind:src bug in bemto HOT 1
- Webpack support HOT 4
- Блок и элемент 2в1. HOT 2
- Scope of elements for block HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bemto.