refactor(styles): replace arbitrary color values with named Tailwind tokens#8166
Open
sujalgoel wants to merge 2 commits intowebpack:mainfrom
Open
refactor(styles): replace arbitrary color values with named Tailwind tokens#8166sujalgoel wants to merge 2 commits intowebpack:mainfrom
sujalgoel wants to merge 2 commits intowebpack:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| @@ -0,0 +1,72 @@ | |||
| @theme { | |||
| /* Brand link colors */ | |||
| --color-brand-link: #1a6bac; | |||
Member
There was a problem hiding this comment.
@copilot does these variabels use the same palette as the ones in https://github.com/webpack/media ?
Member
alexander-akait
left a comment
There was a problem hiding this comment.
looks good, let's recheck color values and we can emrge
Contributor
Contributor
Author
|
Strange! I will take a look @TusharThakur04 thank you. |
…me tokens @import "tailwindcss" caused two regressions: Tailwind's base layer overrode the site font, and spacing utilities switched from fixed pixel values to calc(var(--spacing) * N), breaking layout across the board. Switch back to @reference "tailwindcss" to avoid emitting preflight and the default theme. Add an explicit :root block in theme.css that mirrors the @theme tokens so var(--color-*) references resolve at runtime for dark mode and other dynamic styles.
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
Part of #8047. Replaces hardcoded hex values across the CSS files with named Tailwind v4 theme tokens defined in a single source-of-truth file.
src/styles/theme.csswith a@themeblock defining all semantic color tokens (brand, heading, aside/callout, table, code, dark mode surfaces)src/styles/index.cssto use@import "tailwindcss"so theme tokens are emitted as CSS custom properties, and to importtheme.cssbeforedark.csssrc/styles/dark.csswith named tokens (bg-[#121212]->bg-dark-bg,bg-[rgba(70,94,105,0.45)]->bg-dark-code-inline-bg, etc.)Markdown.csswith named tokens for heading, aside, table, and code styles; added@reference "../../styles/theme.css"for token accessstyle={{ background: "none", border: "none" }}into className inMessageBar.jsxNo colors change. Same hex values, now with names.
What kind of change does this PR introduce?
Refactor. No behavior or visual changes.
Did you add tests for your changes?
No.
Does this PR introduce a breaking change?
No.
If relevant, what needs to be documented once your changes are merged or what have you already documented?
N/A
Use of AI
No.