Add on-demand CSS: registry, pre-computed component classes, header compression
Some checks failed
Build and Deploy / build-and-deploy (push) Failing after 42s
Some checks failed
Build and Deploy / build-and-deploy (push) Failing after 42s
- Parse tw.css into per-class lookup registry at startup
- Pre-scan component CSS classes at registration time (avoid per-request regex)
- Compress SX-Css header: 8-char hash replaces full class list (LRU cache)
- Add ;@css comment annotation for dynamically constructed class names
- Safelist bg-sky-{100..400} in Tailwind config for menu-row-sx dynamic shades
- Client sends/receives hash, falls back gracefully on cache miss
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
40
shared/static/styles/tailwind.config.js
Normal file
40
shared/static/styles/tailwind.config.js
Normal file
@@ -0,0 +1,40 @@
|
||||
/** @type {import('tailwindcss').Config} */
|
||||
module.exports = {
|
||||
safelist: [
|
||||
// ~menu-row-sx builds bg-{colour}-{shade} dynamically via (str ...)
|
||||
// Levels 1–4 produce shades 400–100 (level 5+ yields 0 or negative = no match)
|
||||
{ pattern: /^bg-sky-(100|200|300|400)$/ },
|
||||
],
|
||||
content: [
|
||||
'/root/rose-ash/shared/sx/templates/**/*.sx',
|
||||
'/root/rose-ash/shared/browser/templates/**/*.html',
|
||||
'/root/rose-ash/blog/sx/**/*.sx',
|
||||
'/root/rose-ash/blog/browser/templates/**/*.html',
|
||||
'/root/rose-ash/market/sx/**/*.sx',
|
||||
'/root/rose-ash/market/browser/templates/**/*.html',
|
||||
'/root/rose-ash/cart/sx/**/*.sx',
|
||||
'/root/rose-ash/cart/browser/templates/**/*.html',
|
||||
'/root/rose-ash/events/sx/**/*.sx',
|
||||
'/root/rose-ash/events/browser/templates/**/*.html',
|
||||
'/root/rose-ash/federation/sx/**/*.sx',
|
||||
'/root/rose-ash/federation/browser/templates/**/*.html',
|
||||
'/root/rose-ash/account/sx/**/*.sx',
|
||||
'/root/rose-ash/account/browser/templates/**/*.html',
|
||||
'/root/rose-ash/orders/sx/**/*.sx',
|
||||
'/root/rose-ash/orders/browser/templates/**/*.html',
|
||||
'/root/rose-ash/shared/sx/helpers.py',
|
||||
'/root/rose-ash/blog/sx/sx_components.py',
|
||||
'/root/rose-ash/market/sx/sx_components.py',
|
||||
'/root/rose-ash/cart/sx/sx_components.py',
|
||||
'/root/rose-ash/events/sx/sx_components.py',
|
||||
'/root/rose-ash/federation/sx/sx_components.py',
|
||||
'/root/rose-ash/account/sx/sx_components.py',
|
||||
'/root/rose-ash/orders/sx/sx_components.py',
|
||||
],
|
||||
theme: {
|
||||
extend: {},
|
||||
},
|
||||
plugins: [
|
||||
require('@tailwindcss/typography'),
|
||||
],
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user