-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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>> = {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typescript ftw 🙌
"@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: does the gulp task require a changeset?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
This pull request introduces several changes to the
@twilio-paste
packages, 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.ts
to 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-theme
task ingulpfile.ts
to handle the transformation and renaming of theme tokens. (packages/paste-design-tokens/gulpfile.ts
) [1] [2]CSS Variables Theme Support:
CSSVariablesTheme
inpackages/paste-theme/src/themes/css-variables/index.ts
to convert tokens to CSS variables and generate a theme.ThemeProvider
to support a new propuseCSSVariables
for 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]