Fixes #13: CSS performance optimizations
- Add CSS minification support to build script (--minify flag)
- Pure JS minifier: removes comments, whitespace, redundant chars
- Reports size reduction percentage
- Preserves CSS custom properties, data URIs, strings
- Refactor _08_themes.css: extend CSS custom properties pattern
- Define theme-specific properties per theme (--rpg-content-bg,
--rpg-content-box-shadow, --rpg-header-text-shadow, etc.)
- Replace triple-theme selector duplication with single [data-theme]
selectors — children inherit variables automatically
- Reduces themes.css from 379 to ~220 lines
- Reduces style.css from 305KB to 294KB (3.8% reduction)
- Add build:css:min npm script for production builds
- Add 9 tests for CSS build: minification, size reduction, CSS
variable preservation, data URI preservation, theme refactoring
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build:css": "node scripts/build-css.js",
|
||||
"build:css:min": "node scripts/build-css.js --minify",
|
||||
"test": "jest",
|
||||
"validate_locale": "node src/i18n/validator.js --watch",
|
||||
"validate_locale_once": "node src/i18n/validator.js"
|
||||
@@ -18,6 +19,7 @@
|
||||
"@babel/preset-env": "^8.0.2",
|
||||
"@jest/globals": "^30.4.1",
|
||||
"chokidar": "^5.0.0",
|
||||
"execa": "^9.6.1",
|
||||
"fs-extra": "^11.3.3",
|
||||
"glob": "^13.0.6",
|
||||
"jest": "^30.4.2"
|
||||
|
||||
Reference in New Issue
Block a user