-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Polaris tokens major version upgrades (#10801)
This PR introduces breaking changes, including additions and deprecations, as part of the major version upgrade to `@shopify/polaris-tokens`. The key changes include: - Introduced `themeNameDefault` constant. - Deprecated `tokens` export (replace with `themeDefault`). - Introduced `themeDefault` export (convenience alias for `themes[themeNameDefault]`). - Deprecated all individual token group exports e.g. `color`, `space`, `motion`, etc... - Deprecated `metadata` export (replace with `metaThemeDefault`). - Introduced `metaThemeDefault` export (convenience alias for `metaThemes[themeNameDefault]`). - Introduced new theme types: * `ThemeName` * `MetaTheme` * `MetaThemeShape` * `MetaTokenGroupShape` * `MetaTokenProperties` * `Theme` - Renamed `MetadataGroup` to `MetaTokenGroupShape`. - Renamed `getCustomPropertyNames` to `getThemeVarNames`. - Introduced `isTokenName` type guard (ensure an unknown value is a valid theme token). - Updated `createVar` utility (now creates a complete CSS variable function e.g. ```ts // Before: createVar('token-name') //=> '--p-token-name' // After: createVar('token-name') //=> 'var(--p-token-name)' ``` - Renamed `createVar` to `createVarName`. - Introduced `createVarName` utility (behaves similar to the legacy `createVar` utility). - Exposed `metaThemes` object containing all meta theme objects (useful for low level integrations such as the Polaris site, Polaris for VS Code, etc...). - Deprecated a collection of unintentionally exposed Polaris utils and types: * `getUnit` * `toEm` * `rem` * `tokensToRems` * `getKeyframeNames` * `removeMetadata` * `MetaBreakpointsTokenGroup` * `BreakpointsAliasDirectionMediaConditions` * `BreakpointsMediaConditions` * `isKeyOf` * `createExact` * `createMetadata` - Deprecated `@shopify/polaris-tokens/json` entry point. --------- Co-authored-by: Sophie Schneider <thesophieschneider@gmail.com>
- Loading branch information
1 parent
05b1dcd
commit 2cdc59f
Showing
44 changed files
with
447 additions
and
326 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@shopify/polaris-tokens': major | ||
--- | ||
|
||
Deprecated a collection of types, utils, and JSON exports |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.