| """Loads and concatenates the modular CSS files under ``static/css/``. |
| |
| Modules are loaded in a deterministic order that matches the cascade: |
| variables first, then layout, then components, then dark-mode overrides. |
| |
| Adding a new stylesheet? Append it to ``_LOAD_ORDER`` below. |
| """ |
|
|
| from __future__ import annotations |
|
|
| from pathlib import Path |
|
|
| _CSS_DIR = Path(__file__).parent / "static" / "css" |
|
|
| _LOAD_ORDER = ( |
| "_variables.css", |
| "_layout.css", |
| "_chatbot.css", |
| "_chat.css", |
| |
| |
| "_perf.css", |
| "_math.css", |
| "_thinking.css", |
| "_legacy.css", |
| "_input.css", |
| "_misc.css", |
| "_modals.css", |
| "_typing.css", |
| "_examples.css", |
| "_hide.css", |
| "_dark.css", |
| ) |
|
|
|
|
| def _load_css() -> str: |
| parts: list[str] = [] |
| for name in _LOAD_ORDER: |
| path = _CSS_DIR / name |
| parts.append(f"/* === {name} === */\n{path.read_text(encoding='utf-8')}") |
| return "\n".join(parts) |
|
|
|
|
| CSS = _load_css() |
|
|