fix: include blog models in Tailwind content scan for tag colours #28
Reference in New Issue
Block a user
Delete Branch "fix/tag-colour-safelist"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Tags on blog posts render as white text on a white background instead of showing their assigned colours (cyan/pink/neutral).
Root Cause
Tag colour classes (
bg-cyan-100,text-cyan-900,bg-pink-100,text-pink-900,bg-zinc-100,text-zinc-800) are generated dynamically inTagMetadata.get_css_classes()inapps/blog/models.py. The Tailwindcontentarray only scanned HTML templates, so the JIT compiler never saw these classes and purged them from the CSS build.Fix
Added
apps/blog/models.pyto the Tailwind content sources intailwind.config.js. The scanner now detects the colour class strings in the Python source and retains them in the built stylesheet.Verified all six tag colour classes are present in the built
styles.css. All tests pass.