-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove generic selectors from rules using !important #80
Comments
We also shouldnt be using div and span as selectors unless thats also present in default style. Equally unmaintainable mess. Im not going to get into this, I would rather re-write the style using a generator and then only doing manual rules to account for theinline styles or something that needs to be manual. |
One ugly consequence of using Wikipedia-Dark/wikipedia-dark.user.css Lines 754 to 761 in a500e22
For example the legend on the first picture of this page shows as just gray squares: |
@oowekyala Thats actually not because of !important rule but this I should have a fix (exclusion) for those later |
@oowekyala upgrade to |
@the-j0k3r Oh ok my bad, sorry for cluttering this issue.
Good to know |
Its done, upgrade |
@the-j0k3r Thanks, it works! |
As I found out, simply removing the important tag isnt enough, but I have separated some of these rules already but there are other rules to be done. along with #79 this is coming along, but its consuming a silly amount of time I should be dedicating to other projects. Hence I always wanted a re-write rather than botched fixes. |
If we were to go with a rewrite for the desktop style, how would we proceed? I'm thinking what I did with the Minerva skin for mobile would be the best approach, but would be fairly time consuming to accomplish. A lot of the current rules are going to be out of place since they're overcompensating for the I could start another branch to explore this. I'd most likely comment out the current rules and start writing the core styles, then begin transplanting bits that make sense to keep. |
I already said several times how best to do it, with a generator then only do manual inline styles. |
Also, with some care all existing valid manual styles can probably just be copied over. That is after generator been run. |
From tests and experience, I can say doing this will ensue a deluge of proverbial worms from opening this can. depending on what is removed. It would probably be safe to remove standard selectors that exist in default CSS from i!mportant rules but this also depends on many other selectors that dont follow the default CSS entries also being removed from !important ,they just cause a cascading effect of (mis-)usage of i!mportant in other rules just so some properties take effect. Overall if its not !important in default CSS I just dont add to the problem, /me dreams of a style generator 😴 💤 |
Generally speaking, we should not be applying
!important
to generic selectors likediv
orspan
(the two biggest pain points in this style), as this causes cascading!important
rules all over the style, creating an unmaintainable mess.This is even more problematic when said selectors have multiple
:not()
pesudoclasses appended, increasing their specificity beyond the capability to be overridden.I've already (mostly) remedied the
div
problem, but we still need to deal withspan
, among others. Even after this is fixed, the majority of the existing rules will still be using an unnecessary!important
flag, and it will be difficult to weed out the cases where it's no longer needed.Perhaps the long-term solution to this might be a rewrite of the desktop style.
The text was updated successfully, but these errors were encountered: