feat(tokens): implement css variable token usage eslint plugin#3205
feat(tokens): implement css variable token usage eslint plugin#3205adamdehaven wants to merge 5 commits into
Conversation
✅ Deploy Preview for kongponents-sandbox ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for kongponents ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
This PR updates the repo to enforce CSS custom property usage for @kong/design-tokens constants (via the new token-constant-requires-css-var ESLint rule), and applies corresponding code changes across components and sandbox pages to use var(--kui-*, <token fallback>) patterns.
Changes:
- Bump
@kong/design-tokensto a PR build that includes the new ESLint rule, and enable the plugin ineslint.config.mjs. - Update multiple Vue components to pass design-token values via CSS variables with JS-token fallbacks (e.g.
var(--kui-icon-size-30, ${KUI_ICON_SIZE_30})). - Update sandbox examples to match the new token usage requirements.
Reviewed changes
Copilot reviewed 30 out of 31 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/components/KTruncate/KTruncate.vue | Use CSS var fallback for icon size token usage. |
| src/components/KTreeList/KTreeItem.vue | Use CSS var fallback for icon size token usage. |
| src/components/KTooltip/KTooltip.vue | Use CSS var fallback for popover offset token usage. |
| src/components/KToaster/KToaster.vue | Use CSS var fallback for icon size token usage. |
| src/components/KTableView/KTableView.vue | Use CSS var fallback for multiple icon size token usages. |
| src/components/KTable/KTable.vue | Use CSS var fallback for icon size token usage. |
| src/components/KStepper/KStep.vue | Use CSS var fallback for step state icon sizes. |
| src/components/KSelect/KSelect.vue | Use CSS var fallback for popover offset token usage. |
| src/components/KPop/KPop.vue | Use CSS var fallback for close icon size token usage. |
| src/components/KMultiselect/KMultiselect.vue | Use CSS var fallback for offset + icon size token usage. |
| src/components/KModalFullscreen/KModalFullscreen.vue | Use CSS var fallback for decorative icon color token usage. |
| src/components/KFilterGroup/InteractivePill.vue | Use CSS var fallback for icon size token usage. |
| src/components/KFilterGroup/FilterPill.vue | Use CSS var fallback for popover offset token usage. |
| src/components/KExternalLink/KExternalLink.vue | Use CSS var fallback for external link icon size token usage. |
| src/components/KEmptyState/KEmptyState.vue | Use CSS var fallback for empty-state icon size token usage. |
| src/components/KDropdown/KDropdown.vue | Use CSS var fallback for popover offset token usage. |
| src/components/KDateTimePicker/KDateTimePicker.vue | Use CSS var fallback for offset + icon size token usage. |
| src/components/KCopy/KCopy.vue | Use CSS var fallback for icon size token usage. |
| src/components/KCollapse/KCollapse.vue | Use CSS var fallback for icon size token usage. |
| src/components/KCodeBlock/KCodeBlock.vue | Use CSS var fallback for icon size token usage. |
| src/components/KCheckbox/KCheckbox.vue | Use CSS var fallback for checkbox icon sizes. |
| src/components/KAlert/KAlert.vue | Use CSS var fallback for alert icon sizes. |
| sandbox/pages/SandboxTreeList.vue | Update sandbox icon color token usage to CSS var fallbacks. |
| sandbox/pages/SandboxPop.vue | Update sandbox offset token usage to CSS var fallbacks (including kpop-attributes). |
| sandbox/pages/SandboxModals.vue | Update sandbox icon color token usage to CSS var fallback. |
| sandbox/pages/SandboxEmptyState.vue | Update sandbox icon color + size token usage to CSS var fallbacks. |
| sandbox/pages/SandboxCollapse.vue | Update sandbox icon color + size token usage to CSS var fallbacks. |
| sandbox/pages/SandboxCard.vue | Update sandbox icon color + size token usage to CSS var fallbacks. |
| package.json | Bump @kong/design-tokens to version containing the new ESLint plugin/rule. |
| pnpm-lock.yaml | Lockfile updates for the new @kong/design-tokens version and transitive changes. |
| eslint.config.mjs | Enable @kong/design-tokens ESLint plugin recommended config for Vue files. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
🔴 PR audit failed. 🔴🔥 Renovate Security PRs detected.There are 4 open renovate security PRs older than 3 days. This PR cannot be merged until all renovate security PRs created more than 3 days ago are resolved. 🔥 PNPM Audit issues detected.PR with those issues cannot be merged. How to resolve:
🔥 PR preview packages detected .PR with those dependencies cannot be merged. 🔥 No test coverage detected.This PR does not include any test coverage changes, but it modifies source code. Please add appropriate tests to cover the changes made in this PR. If you believe this is a false positive or if there are valid reasons for not including test coverage changes, please request an exemption by adding the 🔥 Old Open Renovate PRs detected.There are 5 open renovate PRs created more than 30 days ago. PR cannot be merged until those old open renovate PRs are resolved. |
Preview package from this PR in consuming applicationIn consuming application project install preview version of kongponents generated by this PR: |
Summary
Implement the
@kong/design-tokenstoken-constant-requires-css-varESLint rule from Kong/design-tokens#656