| name | theme-normalizer |
| description | Normalize hard-coded HEX colors in deck MDX files into slide CSS variables
derived from deck.config.ts theme.colors. Use dry-run first, then apply with
write mode when a deck should follow theme variables consistently.
|
Theme Normalizer
Unify hard-coded MDX colors into deck-theme CSS variables.
Use When
decks/<deck>/*.mdx still contains repeated hard-coded HEX values
- Theme changes should propagate reliably through slide variables
- A deck needs maintainable color usage before review or branding updates
Workflow
- Select the target deck
- Run dry-run first
pnpm exec tsx .codex/skills/theme-normalizer/scripts/normalize-theme.ts --deck <deck>
- Narrow the target file set when needed
pnpm exec tsx .codex/skills/theme-normalizer/scripts/normalize-theme.ts \
--deck <deck> \
--files "03-*.mdx"
- Apply changes only after reviewing candidates
pnpm exec tsx .codex/skills/theme-normalizer/scripts/normalize-theme.ts \
--deck <deck> \
--write
- Review the diff and rerun with narrower scope if needed
Replacement Rules
- Replace only normalized HEX values defined in
theme.colors
- Matching is case-insensitive exact HEX match
- Do not rewrite colors outside the mapped theme values
Notes
- See
references/color-mapping.md for full mapping detail.
- Gradients and non-HEX color expressions are intentionally excluded.