https://bugzilla.wikimedia.org/show_bug.cgi?id=61440

--- Comment #7 from Matthew Flaschen <[email protected]> ---
(In reply to Krinkle from comment #5)
> To override a style, always use the same selector as the original style and
> you'll be fine.

That isn't appropriate in all cases.  Say there are rules for a fooSelector
elsewhere.  You want to style barSelector.  Either "barSelector elements" is a
subset of "fooSelector elements", or the sets intersect.

In the case of a conflict, you want to override the rules associated with
fooSelector.

Simply using fooSelector again is not correct.  It can unintentionally re-style
elements you want to leave alone.

If they are overlapping sets, it will also omit elements you *do* want to style
(things that are barSelector but *not* fooSelector)

However, it's true that adding specificity usually works well in these
scenarios.  Sometimes this can be done naturally, e.g. with a meaningful
container element:

.bar-root barSelector

However, as you said, !important is part of CSS, whether we like it or not, and
it needs to work properly (including in our version).

Note, I've ported it to to the JavaScript repo now
(https://github.com/cssjanus/node-cssjanus/pull/27)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to