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/.

Change #1053038 had a related patch set uploaded (by Aditya0545; author: Aditya0545):

[mediawiki/extensions/DiscussionTools@master] DiscussionTools: Remove !important from header CSS Removed !important from font family definitions .ext-discussiontools-visualenhancements-enabled .ext-discussiontools-init-section and .ext-discussiontools-visualenhancements-enabled .ext-discussiontools-init-section > h2. This change allows easier font customization without needing !important in custom CSS.

https://gerrit.wikimedia.org/r/1053038

Change #1053038 abandoned by Aditya0545:

[mediawiki/extensions/DiscussionTools@master] DiscussionTools: Remove !important from header CSS Removed !important from font family definitions .ext-discussiontools-visualenhancements-enabled .ext-discussiontools-init-section and .ext-discussiontools-visualenhancements-enabled .ext-discussiontools-init-section > h2. This change allows easier font customization without needing !important in custom CSS.

Reason:

typo error

https://gerrit.wikimedia.org/r/1053038

Change #1053039 had a related patch set uploaded (by Aditya0545; author: Aditya0545):

[mediawiki/extensions/DiscussionTools@master] DiscussionTools: Remove !important from header CSS

https://gerrit.wikimedia.org/r/1053039

Change #1053039 abandoned by Aditya0545:

[mediawiki/extensions/DiscussionTools@master] DiscussionTools: Remove !important from header CSS

https://gerrit.wikimedia.org/r/1053039

Change #1053042 had a related patch set uploaded (by Aditya0545; author: Aditya0545):

[mediawiki/extensions/DiscussionTools@master] DiscussionTools: Remove !important from header CSS Removed !important from font-family definitions in .ext-discussiontools-visualenhancements-enabled .ext-discussiontools-init-section and .ext-discussiontools-visualenhancements-enabled .ext-discussiontools-init-section > h2. This change allows default font i.e sans-serif without needing !important in custom CSS.

https://gerrit.wikimedia.org/r/1053042

Change #1053039 restored by Aditya0545:

[mediawiki/extensions/DiscussionTools@master] DiscussionTools: Remove !important from header CSS

https://gerrit.wikimedia.org/r/1053039

Change #1054016 had a related patch set uploaded (by Aditya0545; author: L10n-bot):

[mediawiki/extensions/DiscussionTools@master] DiscussionTools: Remove !important from header CSS

https://gerrit.wikimedia.org/r/1054016

Change #1054016 abandoned by Aditya0545:

[mediawiki/extensions/DiscussionTools@master] DiscussionTools: Remove !important from header CSS

https://gerrit.wikimedia.org/r/1054016