Repository navigation
Share the colors between TypeScript and CSS - #66
Merged
Merged
Conversation
Deploying create-cpu-c8345196-9409-4cce-afc4-389f413ad8ee with
|
| Latest commit: |
642ed4d
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://8839e768.create-cpu-c8345196-9409-4cce-afc4-389f413ad8ee.pages.dev |
| Branch Preview URL: | https://share-colors-with-css.create-cpu-c8345196-9409-4cce-afc4-389f413ad8ee.pages.dev |
chelproc
force-pushed
the
share-colors-with-css
branch
from
October 31, 2026 03:27
9fe54ed to
fb86e90
Compare
Rename index.css to style.css and define the colors there as custom properties named --color-*, so that stylesheets can use them. Define the same colors as `theme.colors` in style.ts next to it, and import them from there directly. theme.ts now only holds the MUI theme.
chelproc
force-pushed
the
share-colors-with-css
branch
from
October 31, 2026 03:30
fb86e90 to
642ed4d
Compare
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.
Make the colors available to stylesheets as well as TypeScript.
src/index.csstosrc/style.cssand define the colors there as custom properties (--color-primary,--color-text-primary, …)theme.colorsinsrc/style.ts; the two have to be kept in sync by handthemefromsrc/style.tsdirectly, renametheme.palettetotheme.colors, and leave only the MUI theme insrc/common/theme.tsThe
colors/--color-*naming follows the System UI theme specification and Tailwind CSS.