Skip to content
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

Evaluate existing tokens integration and outline an approach to support theming #9987

Closed
1 of 2 tasks
Tracked by #9986
aaronccasanova opened this issue Aug 9, 2023 · 2 comments
Closed
1 of 2 tasks
Tracked by #9986
Assignees
Labels

Comments

@aaronccasanova
Copy link
Member

aaronccasanova commented Aug 9, 2023

Tasks

@aaronccasanova
Copy link
Member Author

aaronccasanova commented Aug 9, 2023

Existing Polaris tokens integration

Polaris tokens serve as the source of truth for design tokens used in Polaris, Web, ~5 peer dependent 1P apps/libraries, and 3P apps. The tokens are organized into token groups, which are JavaScript objects containing tokens related to specific conceptual categories such as color, font, and spacing. During the build process, these token groups are combined to generate various assets, including:

  • ESM and CJS tokens
    • Simplified token-group objects with key/value pairs only
    • Complete token-group objects with full metadata
  • JSON tokens
    • Complete token-group objects with full metadata
  • SCSS stylesheets
    • Media queries stylesheet with Sass variables for each breakpoint media condition
    • Root stylesheet with all token-groups converted to custom properties
  • CSS stylesheet
    • Root stylesheet with all token groups converted to custom properties

The Polaris library imports the Polaris tokens root SCSS stylesheet in the AppProvider, which assigns all custom properties to the :root selector. Web includes the AppProvider in a collection of high level components, which includes our tokens stylesheet in the built application. This allows a single set of custom properties assigned to :root to be shared between components in Polaris, Web, and the ~5 peer dependent libraries in the Admin (without runtime CSS in JS).

@aaronccasanova aaronccasanova changed the title Evaluate the current token integration in Polaris/Web and outline a incremental approach to support theming Evaluate existing tokens integration and outline an approach to support theming Aug 9, 2023
@aaronccasanova aaronccasanova self-assigned this Aug 9, 2023
@sam-b-rose sam-b-rose added Tokens and removed v12 labels Aug 15, 2023
@aaronccasanova
Copy link
Member Author

aaronccasanova commented Sep 7, 2023

Closed by #10290 and #10103

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants