Page MenuHomePhabricator

DiscussionTools header CSS abuses !important
Open, Needs TriagePublicBUG REPORT

Description

Currently, both .ext-discussiontools-visualenhancements-enabled .ext-discussiontools-init-section and .ext-discussiontools-visualenhancements-enabled .ext-discussiontools-init-section > h2 selectors have !important in their font-family definitions. This makes it harder to customise fonts, since you also need an !important in any customisation to make it work, which doesn’t make much sense. I prefer default serif font headings and wanted to customise discussion header for myself to this:

image.png (643×2 px, 134 KB)

but to make it work, I had to add !importants everywhere, even though CSS handles specificity fine anyway on those selectors. It is a small issue, but I suggest you’d reconsider this, since usually !importants are discouraged without a good reason.

Event Timeline

We would typically only add the importants if necessary. In this case it is probably for another skin, maybe Minerva or Monobook?

https://gerrit.wikimedia.org/g/mediawiki/extensions/DiscussionTools/+/4496b2477147212ea13154183a399137c21fc788/modules/dt.init.less doesn’t provide any explanation for both and whether they do anything in any skin. It might be the case, of course.

If you confirm that removing these !importants doesn't affect any Wikimedia-deployed skins, I'd be happy to approve a patch. You can just submit it and test on https://patchdemo.wmflabs.org/.