StylishThemes / Wikipedia-Dark

:mortar_board: Dark Wikipedia
https://github.com/StylishThemes/Wikipedia-Dark/raw/master/wikipedia-dark.user.css
Other
486 stars 31 forks source link

Small tweaks #199

Closed ColonelGerdauf closed 1 year ago

ColonelGerdauf commented 2 years ago

removed redundancies corrected a faulty rule param corrected group orientations [incomplete]

ColonelGerdauf commented 2 years ago

Finished the cleanup of rules. Found a few more redundancies.

When writing or modifying a rule; keep this order in mind

objects conditions classes id's

the-j0k3r commented 2 years ago

This is very well fine and dandy contribution (so thanks for taking the time) but ignores a couple things off the top of my head.

Add version patch, this is internal development only (please dont) No perfectionist ran on this selectors are now in separate lines (please do)

No idea how many breakages this will introduce, given the sheer insanity that we try to accommodate in a single style for a zillion pages.

@AfroThundr3007730 for final decision.

AfroThundr3007730 commented 1 year ago

From what I can see after reviewing this, you split the selectors to be one per line, then sorted them by type. It looks like there are no functional changes, aside from removing a redundant selector above.

To reduce the size of the CSS, we typically run perfectionist to group the selectors, which your first commit basically reverses. If we wanted to go with a one selector per line format, sorting them (as per your second commit) makes sense.

So what advantages do we gain from this expanded and sorted format? If the goal is increased legibility and maintainability, I would agree on that point. The 10% line count increase doesn't actually increase the file size much (2KB).

Still, there's not much reason to do a reformatting on its own, I think, unless this is meant to be followed up with further changes. @ColonelGerdauf and @the-j0k3r thoughts?

ColonelGerdauf commented 1 year ago

The reason for splitting the selectors to one per line is that it makes it significantly easier to review the existing selectors and seek problematic or redundant entries.

As noted by Joker, the current code base as it was was a nightmare in terms of legacy code with immense difficulties in removing outdated entries. This now should make it easier for people to troubleshoot.

ColonelGerdauf commented 1 year ago

Another benefit of separating the selectors to line by line is that it makes the process simple of merging selectors with the same declarations. It might make the code look a bit ugly, but in my opinion it is much easier than finding the same list of declarations written two or three times.