-
Notifications
You must be signed in to change notification settings - Fork 76
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
chore(themed): add token CSS variable test helper #9860
Conversation
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.
👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾
👾🪙🪙🪙🪙👾🪙👾👾👾👾👾🪙👾🪙🪙🪙🪙👾👾🪙🪙🪙👾👾🪙🪙👾👾🪙👾👾👾🪙👾🪙🪙🪙🪙👾🪙👾
👾🪙👾👾🪙👾🪙👾👾👾👾👾🪙👾🪙👾👾👾👾🪙👾👾👾👾🪙👾👾🪙👾🪙🪙👾🪙🪙👾🪙👾👾👾👾🪙👾
👾🪙🪙🪙🪙👾🪙👾👾🪙👾👾🪙👾🪙🪙🪙👾👾👾🪙🪙👾👾🪙👾👾🪙👾🪙👾🪙👾🪙👾🪙🪙🪙👾👾🪙👾
👾🪙👾👾🪙👾🪙👾🪙👾🪙👾🪙👾🪙👾👾👾👾👾👾👾🪙👾🪙👾👾🪙👾🪙👾👾👾🪙👾🪙👾👾👾👾👾👾
👾🪙👾👾🪙👾👾🪙👾👾👾🪙👾👾🪙🪙🪙🪙👾🪙🪙🪙👾👾👾🪙🪙👾👾🪙👾👾👾🪙👾🪙🪙🪙🪙👾🪙👾
👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾👾
This should be good to merge once comments are addressed.
Before merging, can you update the PR title to "...: add token CSS ...", so it follows conventions? |
I've had to duplicate the theme code because I can't find a folder that the demos and storybook servers share. |
…-to-monorepo * origin/dev: ci: fix env var case in workflows (#9877) docs(action): deprecates the compact property (#9847) fix(tab-title): Adjust hover styling for `bordered` Tab Title (#9867) chore(themed): add token CSS variable test helper (#9860) chore: avoid deleting untracked, non-generated files on npm run clean (#9866) chore(pick-list, pick-list-item, value-list-item): fix runtime deprecation messages (#9870) refactor: create a common resource to store debounce consts (#9829) test(tree): stabilize tests (#9853) chore(value-list-item): add runtime deprecation warning (#9863) chore: release next build(deps): update dependency composed-offset-position to v0.0.6 (#9834) feat(dialog): adds new dialog component and deprecates the modal component (#9751) chore: release next fix(panel, flow-item): prevent footer slots from conflicting with each other (#9856)
**Related Issue:** #7180 ## Summary Includes helpers which assist developers in testing and theming component tokens as CSS variables. ### EXAMPLE USAGE: #### Demo page ```html <demo-theme tokens="--calcite-button-background-color, --calcite-button-border-color, --calcite-button-text-color" ><calcite-button kind="inverse" scale="l"> Button </calcite-button ></demo-theme> ``` #### Storybook / Chromatic ```ts export const theming_TestOnly = (): string => html` <style> .container { ${setCSSVariables([ "--calcite-button-background-color", "--calcite-button-border-color", "--calcite-button-text-color", ])} } </style> <div class="container"> <calcite-button kind="inverse" scale="l"> Button </calcite-button> </div> `; ``` #### E2E ```ts describe("theme", () => { themed(`<calcite-button kind="inverse" scale="l"> Button </calcite-button>`, { "--calcite-button-background-color": { shadowSelector: ".button", targetProp: "backgroundColor", }, "--calcite-button-text-color": { shadowSelector: ".button", targetProp: "color", } "--calcite-accordion-border-color": { shadowSelector: ".button", targetProp: "borderColor", }, }); }); ```
Related Issue: #7180
Summary
Includes helpers which assist developers in testing and theming component tokens as CSS variables.
EXAMPLE USAGE:
Demo page
Storybook / Chromatic
E2E