-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Closed
Description
The idea would be to be able to do things like this:
Input CSS
@variants children {
.block { ... }
}
Output CSS
.children:block > * { display: block; }
.block { display: block; }
Note: All children: variants would need to be output before the normal rule-sets so children can override rules defined by their parent (.class and .class > * have the same specificity).
HTML
<div class="children:block children:my-1">
<a>
I am a block with some vertical margin
</a>
<a>
Me too
</a>
<a class="mb-0">
I don't have bottom margin
</a>
</div>
Advantages
- Less repetition in the HTML (easier to change things that should be changed together)
- Easier to read
- Smaller HTML file size
I think this would be particularly useful for grids and lists. What do you think?
hacknug, longnt80, luishdez, robindrost, andreich1980 and 7 more
Metadata
Metadata
Assignees
Labels
No labels