Use static Tailwind classes for settings code blocks - #1657
skyfallwastaken wants to merge 1 commit into
Conversation
Amp-Thread-ID: https://ampcode.com/threads/T-01a05ac9-b26b-715c-8e53-619cd47998e0 Co-authored-by: Amp <amp@ampcode.com>
Greptile SummaryThis PR replaces a dynamically constructed Tailwind text-size class with a statically discoverable, type-safe class mapping while preserving the existing
Confidence Score: 5/5The PR appears safe to merge with no actionable regressions identified. The only current caller uses the valid default size, and the static mapping preserves both supported size options while making their Tailwind classes discoverable during compilation. Important Files Changed
Reviews (1): Last reviewed commit: "Use static classes for settings code blo..." | Re-trigger Greptile |
There was a problem hiding this comment.
Pull request overview
This PR fixes Tailwind CSS class discovery for the Settings CodeBlock component by replacing a dynamically constructed text-${size} utility with a static mapping, ensuring the required font-size utilities are always present in the generated CSS.
Changes:
- Introduced a
sizeClassesmap from the allowedxs/smsize options to static Tailwind classes (text-xs,text-sm). - Updated the prop type for
sizeto be derived fromsizeClasseskeys to keep types in sync with the mapping. - Switched the
<pre>class construction to usesizeClasses[size]rather than a dynamic Tailwind class string.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
f1786c8 to
6101271
Compare
Summary of the problem
The settings code block built its text size as
text-${size}. Tailwind cannot detect these dynamic class names, so the generated styles depended on unrelated source files containing each size.Describe your changes
Map the typed
xsandsmsize options to statictext-xsandtext-smclasses so Tailwind discovers both without changing rendered output.Screenshots / Media
Not applicable. There is no visual change.