Lesson #1452

← Back to Knowledge Board
Design changes belong in template, never in framework code
ID
1452
Author
ai
Agent
agent-claude
Reviewed
✓ Yes
Source authority
75 / 100
Source
Per-tenant visual styling (italic, color, font, padding) must live in the active template, not in shared framework helpers
Source issue
β€”
Created at
2026-05-12T10:00:22.817592+00:00
Valid until
β€”
Deprecated at
β€”
Supersedes
β€”
Obsidian path
/root/.claude/projects/-nvmetank1-projects/memory/feedback_design_in_template.md
Obsidian hash
18d0be440c09d534fb35e070ace124a2
Tags
claude-memory,feedback

Content

**Rule:** Visual / design / styling decisions for a specific look (cmoments brown+italic, miraculix green+druiden, etc.) ALWAYS live inside the active template, NEVER in shared framework code (`routes/_public_sections.py`, `_ui_css.py`, `ui.py`, etc.).

**Why:** User stated 2026-05-05: "merke dir design Γ€nderungen immer nur im template!!!!" β€” context: I changed `.ykurse-hero h1 em{font-style:normal}` directly in `routes/_public_sections.py` to fix italic-off for cmoments hero overlines. But that change leaks to ALL templates (cmoments, miraculix, future ones). Different tenants should be able to keep italic. Framework code should expose neutral defaults; templates override.

**How to apply:**
- When the user asks for an italic/color/spacing/font tweak that ONLY makes sense for one tenant, find that tenant's template (e.g. `templates/_presets/special.py` for cmoments, the miraculix `template.py` etc.) and add the override there.
- Touch `routes/_public_sections.py` / `_ui_css.py` / `ui.py` only for STRUCTURAL fixes (overflow:visible to fix dropdown clipping β†’ applies cross-tenant), behavior fixes (close-handlers, capture-phase), or genuinely framework-wide defaults.
- If a design rule already lives in framework code by accident, MOVE it to the template, don't just leave it.

**Tenant-template inventory (yoga repo, 2026-05-05):**
- `templates/manifests/cmoments.md` β€” cmoments tenant manifest
- `templates/_presets/special.py` etc. β€” preset CSS bundles
- Miraculix uses different APP_NAME / colors via `/docker-yaml/ai-stack.yml` env (`APP_TITLE=Miraculix`, `BRAND_ICON=spa`, `PRIMARY_COLOR=#2D5F3F`)

**Examples to remember:**
- `.ykurse-hero h1 em{font-style:normal}` belongs in cmoments template, not `routes/_public_sections.py`.
- Hero brown color `var(--cm-accent)` is template-overridable via `--cm-accent`.
- Card-box `overflow:visible` β†’ framework (fixes structural clipping bug, applies to all templates).