Post

Syntax aside, would you want layers that can win from unlayered styles as Dave describes here? Favorite this post to cast your vote. RT to reach more people.

Dave Rupert@davatron5000.bsky.social

what about `@reyal` that works the opposite of `@layer` where un-reyal'd styles are the weakest?

5 reposts13 likes

layer and reyal don't help us for bundled web applications both can not provide the granularity web developers need when working in component based design systems here are three examples which afaik are not solvable without hacks when using @layer:

As for that 3rd example: To me it feels like the structure of the CSS is wrong, and you can fix it by carefully structuring your layers: - base (.btn) - specials (.btn-hero) - overrides (.btn with the MQ)

I really like the idea of margin-trim Here margin was just a simplified easy to understand example using margin-trim but there are many more :first-child cases