feat(theme): add option to use css variables#4264
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
|
🦋 Changeset detectedLatest commit: 1cd640e The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
View your CI Pipeline Execution ↗ for commit 1cd640e.
☁️ Nx Cloud last updated this comment at |
Paste
|
||||||||||||||||||||||||||||
| Project |
Paste
|
| Branch Review |
add-css-vars-to-theme-proivder
|
| Run status |
|
| Run duration | 04m 46s |
| Commit |
|
| Committer | Kristian Antrobus |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
67
|
| View all changes introduced in this branch ↗︎ | |
|
Size Change: +295 B (0%) Total Size: 1.12 MB
ℹ️ View Unchanged
|
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 1cd640e:
|
Paste
|
||||||||||||||||||||||||||||
| Project |
Paste
|
| Branch Review |
add-css-vars-to-theme-proivder
|
| Run status |
|
| Run duration | 06m 49s |
| Commit |
|
| Committer | krisantrobus |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
125
|
| View all changes introduced in this branch ↗︎ | |
| const convertToCSSVariables = ( | ||
| tokens: GenerateThemeFromTokensArgs | object, | ||
| ): Partial<Record<keyof GenerateThemeFromTokensArgs, string | object>> => { | ||
| const cssVariables: Partial<Record<keyof GenerateThemeFromTokensArgs, string | object>> = {}; |
| "@twilio-paste/design-tokens": minor | ||
| --- | ||
|
|
||
| [Design Tokens] added a new build script to generate a CSS file that applies variables for individual themes using the body[data-theme] attribute. |
There was a problem hiding this comment.
question: does the gulp task require a changeset?
There was a problem hiding this comment.
It didn't kick one off but I think it would be good to include a changeset for this, something we should be communicating I feel.
Co-authored-by: Nora Krantz <75342690+nkrantz@users.noreply.github.com>
This pull request introduces several changes to the
@twilio-pastepackages, focusing on adding support for CSS variables and enhancing theme management. The key updates include a new build script for generating CSS files with theme variables, modifications to thegulpfile.tsto support the new build process, and updates to the theme provider to handle CSS variables.Key Changes:
Theme Management Enhancements:
New Build Script for CSS Variables:
tokens:data-themetask ingulpfile.tsto handle the transformation and renaming of theme tokens. (packages/paste-design-tokens/gulpfile.ts) [1] [2]CSS Variables Theme Support:
CSSVariablesThemeinpackages/paste-theme/src/themes/css-variables/index.tsto convert tokens to CSS variables and generate a theme.ThemeProviderto support a new propuseCSSVariablesfor applying CSS variables theme. (packages/paste-theme/src/themeProvider.tsx) [1] [2] [3] [4] [5]Testing and Documentation:
packages/paste-theme/__tests__/__snapshots__/themes.spec.ts.snap,packages/paste-theme/__tests__/themes.spec.ts) [1] [2] [3]