Replies: 4 comments
-
Having an idea of what is at play here would help my understanding. If I read this correctly I would assume what really exists is:
And the what's really needed is:
Assuming I'm reading it incorrectly it's also possible this is a special case:
I'd need more details on the actual block/element/modifiers in question to give a better idea. |
Beta Was this translation helpful? Give feedback.
-
Here the existing case : Here's the complete example , my struggle is naming the class you see here
|
Beta Was this translation helpful? Give feedback.
-
Assuming the same markup this is what I would do, largely because I think the toggle is a sub-element of the form. <label class="form__checkbox_toggle form__checkbox_toggle--small">
<input type="checkbox">
<span class="form__checkbox_button">
<!-- I'd move this icon to a :before or :after CSS selector -->
<svg class="icon icon-ok">
<use xlink:href="img/sprite.svg#icon-ok"></use>
</svg>
</span>
<span class="form__checkbox_label-text">Option 2 — initial state </span>
</label> It's not perfect. And I'd probably remove a lot of the markup here, but I don't know the UI. So the markup may be needed. |
Beta Was this translation helpful? Give feedback.
-
OK, i agree. The mistake is in the use of the markup and It's better having a separated object of checkbox toggle than having to add a modifier applied on a modifier. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
My case is different than the existing question "Why do I need to combine block and prefixed modifier class for a modified block?"
What I'd like to know , is what to do when I have a variation to apply on a modifier. Example :
Can I do
.block--mod--special
?<div class=”block block--mod block--mod--special”>
The explanation is that the modifier .block--mod--special can only be used along with the existing modifier .block--mod.
( This will never exist :
.block--special
)I could create
.block--mod-special
, but it'll require to duplicate base rules of block--mod in.block--mod-special
.I'm not sure what is best.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions