-
Notifications
You must be signed in to change notification settings - Fork 49
[Project Solar / Phase 1 / Engineering Follow-ups] Fix issues with outputReferences and isThemeable
#3446
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
base: project-solar/phase-1-main-feature-branch
Are you sure you want to change the base?
Conversation
…c to handle aliasing (outputReferences) and files splitting (“common” vs “themed”)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Pull request overview
This PR refactors the token build system to properly handle themed tokens with improved aliasing (outputReferences) and theming capabilities. The main changes address custom CSS formatting for themed tokens, validation of generated CSS files, and better code organization through abstraction of reusable functions.
Key changes:
- Implemented custom CSS format function with logic for handling aliasing and splitting tokens into "common" vs "themed" files
- Added validation step to ensure generated themed CSS files are consistent and have no orphaned CSS variables
- Abstracted reusable functions (
getSourceFromFileWithRootSelector,customFormatDocsJson) into separate files for better maintainability
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
packages/tokens/scripts/build.ts |
Removed attributes/themeable transform; added custom format and validation action registrations; enabled StyleDictionary logging |
packages/tokens/scripts/build-parts/validateThemingCssFiles.ts |
New validation action to check consistency of common/themed CSS files and detect orphaned CSS variables |
packages/tokens/scripts/build-parts/getStyleDictionaryConfig.ts |
Updated to use custom formats; added validation action to build pipeline; enabled logging configuration |
packages/tokens/scripts/build-parts/getSourceFromFileWithRootSelector.ts |
New utility function to read and strip headers from generated CSS files |
packages/tokens/scripts/build-parts/generateThemingCssFiles.ts |
Refactored to use abstracted getSourceFromFileWithRootSelector function |
packages/tokens/scripts/build-parts/customFormatDocsJson.ts |
Abstracted docs JSON formatting logic into its own file |
packages/tokens/scripts/build-parts/customFormatCssThemedTokens.ts |
New custom format implementation with advanced aliasing and reference resolution logic |
… commit)" This reverts commit 455d9ec.
1945f70 to
c5082a3
Compare
📌 Summary
Important
This PR is the cleaned-up version of #3435.
For details look at the PR description, and the commits history.
🛠️ Detailed description
In this PR I have:
getSourceFromFileWithRootSelectormethod in its own file, so it could be reusedDocsJsoncustom format to its own fileattributes/themeablecustom transform (not needed anymore)testtokens (so we can turn them on again in the future, if we want)🔗 External links
Jira tickets:
👀 Component checklist
💬 Please consider using conventional comments when reviewing this PR.
📋 PCI review checklist
Examples of changes to controls include access controls, encryption, logging, etc.
Examples include changes to operating systems, ports, protocols, services, cryptography-related components, PII processing code, etc.