Skip to content

Remove CSS rules that no page uses anymore - #122

Open
jsshin2022 wants to merge 1 commit into
mainfrom
drop-unused-css
Open

jsshin2022 wants to merge 1 commit into
mainfrom
drop-unused-css

Conversation

@jsshin2022

Copy link
Copy Markdown
Member

The level rail and the old one-level panel were replaced in #117 and #121, but their styles stayed in hub.css, along with a few older sections.

This removes a rule only when one of its classes or ids is not found anywhere in the HTML, JS, Python build scripts or data files. Classes built from a prefix in JS (lv-${...}, s-${...}, k-${...} and similar) are kept, and classes inside :not() are not counted. Keyframes that nothing animates are removed too.

  • hub.css: 251 KB to 214 KB, about 420 lines fewer
  • Before/after screenshots of every page (hub, library, game, lab, article, 404, Builder pages), with the level test, station dialog, map tab, glossary tab and an opened Level 3, at 1440 and 390 px in light and dark: 52 pairs, 0 pixels different

Generated by Claude Code

The level rail, the old level panel and a few earlier sections left about
420 selectors behind. A rule is dropped only when one of its classes or ids
appears nowhere in the HTML, JS, Python or data files, with classes built
from a prefix in JS kept. hub.css goes from 251 KB to 214 KB.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant