-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: Update CustomProperties component to use JSON tokens #4811
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: Update CustomProperties component to use JSON tokens #4811
Conversation
|
https://github.com/Shopify/polaris-react/blob/main/loom.config.ts#L154 is a demo of adding additional rollup plugins. You'll need to add |
… into feat/json-tokens
…-react into feat/json-token-custom-properties
kyledurand
left a comment
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.
🤩
| return `${parseInt(px, 10) / BASE_FONT_SIZE}rem`; | ||
| function rem(value: string) { | ||
| return value.replace( | ||
| // https://regex101.com/r/RBL7EE/1 |
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.
These links are temporary right? Not sure it's worth leaving as a comment. Easy enough just to copy and paste and add a few examples
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.

In addition to the above screenshot, I verified in their GitHub API and FAQ wikis these are permalinks. I actually like having this reference as we can make sure the existing test cases still pass during future updates. That said, I'm also fine with removing the link as it's now checked into source control if we ever need it.
1236e66 to
66e6bab
Compare
WHAT is this pull request doing?
This PR updates the
CustomPropertycomponent to use the recently added JSON tokens.tokensdirectory with a singletokens.ts(This simplifies the implementation while still maintaining an opinion on the structure of the tokens object and how it's consumed in TypeScript files)
tokens.tsto import the JSON token filesHow to 🎩
🖥 Local development instructions
🗒 General tophatting guidelines
📄 Changelog guidelines
Copy-paste this code in
playground/Playground.tsx:🎩 checklist
README.mdwith documentation changes