Repository navigation
fix(maintainers): render library chip backgrounds and neutralize badge text - #1496
Merged
Merged
Conversation
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Library chips rendered with no background at all. This restores them and fixes the text color that the missing background had been hiding.
This is a regression, not a new design. #1027 changed every
bgStylefrom a stock Tailwind color (bg-red-500,bg-emerald-500, …) to a design system token (bg-category-*) but left the existing safelist inapp.cssuntouched.Screenshots
Filter dropdown and selected chip —
/maintainersEvery unselected library button is
${bgStyle}/30, and the selected chip above is${bgStyle}/40. In the current build all 21 buttons are bare text on the panel.Row view badges —
/maintainersNote
Start,Router,Query,FormandStore— bare green text, while every neighbouring chip has a background.Row view badges —
/paid-supportThe second affected route, sharing
MaintainerRowCard.The background bug
Library chips build their class with a template string:
Tailwind v4 scans source files as text, so an assembled string is never found and the CSS is never generated. Every chip computed to
rgba(0, 0, 0, 0).app.cssalready carries a safelist for exactly this case, under the comment "Safelist for dynamic colors". This adds the currentbgStylevalues to it.One value rendered by accident:
bg-amber-500/30exists literally at__root.tsx:445, so that one class was generated while its/40sibling was not.The text color bug
With the background transparent,
text-green-900 dark:text-green-200sat on the page background and looked fine. Once the background renders, every library gets green text regardless of its category —Querybecame green on terracotta,Formgreen on cyan. Light mode was the worse of the two.All three badge sites now use
text-text-primary.The
bg-gray-500fallback is replaced withbg-category-tooling, matching the fallback already used by the dropdown above it, which also letbg-gray-500stay out of the new safelist.Scope
LibraryBadgerenders only insideMaintainerRowCard, and only when nolibraryIdis passed, so two routes change:/maintainers/paid-support.../docs/contributorslibraryId/workshopshideLibrariesVerification
Measured on rendered elements in both light and dark:
/maintainers, 24 on/paid-support, and the selected filter chip all paint/30,/40andhover:/40generated for every categorytext-green-900left in the DOMtsc --noEmitcleanbg-fuchsia-500andbg-amber-500stay as-is — those are the actual brand colors for Markdown and Highlight, and assigning them a category is a design system call, not a fix.