top | item 47027848

(no title)

afiori | 15 days ago

Without a lot of discipline it is very easy to end up with a css with lots of unclear and hard to guess effects. Eg consider the case of <A type=1><B><A type=2></A></B></A> where A and B are complex templates. Any selector with the " " operator on A risk expanding to the inner A even if it was intended only for the outer. Similarly a :has selector might catch a descendant of the wrong element.

@scope fixes a lot of this, but it is a complex problem. With tailwind you mostly have to worry about inheritance

discuss

order

the_other|14 days ago

> Any selector with the " " operator on A risk expanding to the inner A even if it was intended only for the outer.

Then <a type=b> is potentially a <c>. Consider a small refactor?

robertoandred|15 days ago

This problem was solved a long time ago with CSS Modules.

christophilus|15 days ago

I prefer almost anything to CSS modules, so this bike shedding topic is probably very subjective.