bem-components
bem-components copied to clipboard
Theme as a modifier results in the need to increase specificity
Continuing the conversation with @veged, I want to discuss the issue with theme as a modifier.
Here are cases:
- To make some block invisible with modifier or mix, user should often use
mustDepson lib's theme or somehow increase specificity as there aredisplayproperties in _theme_islands (e.g. https://github.com/bem/bem-components/blob/v2/design/common.blocks/button/_theme/button_theme_islands.styl#L7). - The same issue appear when user wants to create layout with the help of mixes with some layout block as such properties as
marginandpaddingare set as well (https://github.com/bem/bem-components/blob/v2/design/common.blocks/button/_theme/button_theme_islands.styl#L9-L10).
Maybe someone will find the way to make it better?
// cc @mishanga
need more real life examples
@tadatuta still waiting to usecases
@narqo you said you have something
@tadatuta @narqo ping
The common usecase which hurts:
{ block : 'button',
mods : { theme : 'islands', size : 'm' },
mix : { block: 'head-toolbar', elem : 'action' },
text : 'New message' }
As @tadatuta has already noticed, you can't add margin style to .head-toolbar__action, without adding mustDeps dependency from button_theme_islands.
The same things happen if try to mix something to elements (or nested blocks) of islands themed blocks, like menu > menu-item or menu-item_type_link > link