Skip to content

Commit

Permalink
fix(*): add design tokens plugin (#1024)
Browse files Browse the repository at this point in the history
* fix(*): add design tokens plugin

* fix: indent
  • Loading branch information
adamdehaven committed Dec 20, 2023
1 parent 2e6591c commit 0d6b971
Show file tree
Hide file tree
Showing 39 changed files with 99 additions and 92 deletions.
6 changes: 5 additions & 1 deletion .stylelintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module.exports = {
rules: {
// Disallow relative font units
'unit-disallowed-list': ['rem', 'em'],
'@kong/design-tokens/use-proper-token': true,
// Only allow @kong/design-tokens or `--kong-ui-*` CSS custom properties
'custom-property-pattern': [
"^(kui-|kong-ui-).+$",
Expand All @@ -28,6 +29,9 @@ module.exports = {
}
}
],
plugins: [ 'stylelint-order' ],
plugins: [
'stylelint-order',
'@kong/design-tokens/stylelint-plugin',
],
rules: { 'order/properties-alphabetical-order': true }
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@commitlint/config-conventional": "^18.4.3",
"@digitalroute/cz-conventional-changelog-for-jira": "^8.0.1",
"@evilmartians/lefthook": "^1.5.5",
"@kong/design-tokens": "^1.12.1",
"@kong/design-tokens": "1.12.3",
"@kong/kongponents": "9.0.0-alpha.73",
"@rushstack/eslint-patch": "^1.5.1",
"@types/flat": "^5.0.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/analytics/analytics-chart/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"devDependencies": {
"@kong-ui-public/i18n": "workspace:^",
"@kong-ui-public/sandbox-layout": "workspace:^",
"@kong/design-tokens": "^1.12.1",
"@kong/design-tokens": "1.12.3",
"@kong/kongponents": "9.0.0-alpha.73",
"@types/uuid": "^9.0.7",
"file-saver": "^2.0.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,12 +273,12 @@ const positionToClass = (position: `${ChartLegendPosition}`) => {
.label {
font-size: $kui-font-size-30;
line-height: $kui-font-size-50;
line-height: $kui-line-height-50;
}
.sub-label {
font-size: $kui-font-size-20;
line-height: $kui-font-size-30;
line-height: $kui-line-height-20;
word-break: none;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ function handleMouseUp() {
display: flex;
flex-direction: column;
margin: $kui-space-40;
min-height: $kui-space-80;
min-height: 24px;
padding-bottom: $kui-space-40;
.title {
Expand Down
2 changes: 1 addition & 1 deletion packages/analytics/analytics-utilities/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@
"date-fns-tz": "^2.0.0"
},
"devDependencies": {
"@kong/design-tokens": "^1.12.1"
"@kong/design-tokens": "1.12.3"
}
}
2 changes: 1 addition & 1 deletion packages/analytics/dashboard-renderer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@kong-ui-public/analytics-chart": "workspace:^",
"@kong-ui-public/i18n": "workspace:^",
"@kong-ui-public/sandbox-layout": "workspace:^",
"@kong/design-tokens": "^1.12.1",
"@kong/design-tokens": "1.12.3",
"@kong/kongponents": "9.0.0-alpha.73",
"json-schema-to-ts": "^2.9.2",
"vue": "^3.3.11"
Expand Down
2 changes: 1 addition & 1 deletion packages/analytics/metric-cards/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"vue": "^3.3.11"
},
"devDependencies": {
"@kong/design-tokens": "^1.12.1",
"@kong/design-tokens": "1.12.3",
"@kong/kongponents": "9.0.0-alpha.73",
"vue": "^3.3.11"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ $row-gap-size: 12px;
}
&.negative {
background-color: var(--kong-ui-metric-card-trend-bg-negative, $kui-color-background-danger-weakest);
color: var(--kong-ui-metric-card-trend-negative, $kui-color-border-danger-strong);
color: var(--kong-ui-metric-card-trend-negative, $kui-color-text-danger-strong);
}
&.neutral {
background-color: var(--kong-ui-metric-card-trend-bg-neutral, $kui-color-background-neutral-weaker);
Expand Down
2 changes: 1 addition & 1 deletion packages/core/app-layout/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"lodash.clonedeep": "^4.5.0"
},
"devDependencies": {
"@kong/design-tokens": "^1.12.1",
"@kong/design-tokens": "1.12.3",
"@kong/kongponents": "9.0.0-alpha.73",
"@types/lodash.clonedeep": "^4.5.9",
"vue": "^3.3.11",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ const displayModified = computed(() => {
:deep(hr),
hr {
background-color: $kui-color-border;
background-color: $kui-color-background-disabled;
border: none;
height: 1px;
margin: $kui-space-0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ defineProps({
&:focus-visible {
border-radius: $kui-border-radius-round;
outline: $kui-border-width-10 solid $kui-navigation-color-text !important;
outline: 1px solid #bee2ff !important;
outline-offset: 2px;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ onBeforeUnmount(() => {
}
.sidebar-level-divider {
/* stylelint-disable-next-line @kong/design-tokens/use-proper-token */
background-color: $kui-navigation-color-border-divider;
height: 1px;
margin: $kui-space-80 auto;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ const navigate = (event: Event, item: SidebarPrimaryItem | SidebarSecondaryItem,
// Add a top border to the ul element, offset from the left and right to prevent overlap
&:before {
/* stylelint-disable-next-line @kong/design-tokens/use-proper-token */
background-color: $kui-navigation-color-border;
content: '';
height: 1px;
Expand Down Expand Up @@ -350,7 +351,7 @@ const navigate = (event: Event, item: SidebarPrimaryItem | SidebarSecondaryItem,
span {
height: auto;
min-width: $kui-space-0; // Important: must be present to truncate the text
min-width: 0; // Important: must be present to truncate the text
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/copy-uuid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
},
"devDependencies": {
"@kong-ui-public/i18n": "workspace:^",
"@kong/design-tokens": "^1.12.1",
"@kong/design-tokens": "1.12.3",
"@kong/kongponents": "9.0.0-alpha.73",
"vue": "^3.3.11"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/core/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"date-fns": "^2.30.0"
},
"devDependencies": {
"@kong/design-tokens": "^1.12.1",
"@kong/design-tokens": "1.12.3",
"axios": "^1.6.2",
"swrv": "^1.0.4"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/documentation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
},
"devDependencies": {
"@kong-ui-public/i18n": "workspace:^",
"@kong/design-tokens": "^1.12.1",
"@kong/design-tokens": "1.12.3",
"@kong/kongponents": "9.0.0-alpha.73",
"axios": "^1.6.2",
"vue": "^3.3.11"
Expand Down
2 changes: 1 addition & 1 deletion packages/core/error-boundary/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"test:unit:open": "cross-env FORCE_COLOR=1 vitest --ui"
},
"devDependencies": {
"@kong/design-tokens": "^1.12.1",
"@kong/design-tokens": "1.12.3",
"@kong/icons": "^1.8.3",
"vue": "^3.3.11"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/core/forms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
},
"devDependencies": {
"@kong-ui-public/i18n": "workspace:^",
"@kong/design-tokens": "^1.12.1",
"@kong/design-tokens": "1.12.3",
"@kong/kongponents": "9.0.0-alpha.73",
"@types/lodash": "^4.14.202",
"pug": "^3.0.2"
Expand Down
2 changes: 1 addition & 1 deletion packages/core/sandbox-layout/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"test:unit:open": "cross-env FORCE_COLOR=1 vitest --ui"
},
"devDependencies": {
"@kong/design-tokens": "^1.12.1",
"@kong/design-tokens": "1.12.3",
"@kong/kongponents": "9.0.0-alpha.73",
"vue": "^3.3.11",
"vue-router": "^4.2.5"
Expand Down
2 changes: 1 addition & 1 deletion packages/entities/entities-certificates/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"devDependencies": {
"@kong-ui-public/i18n": "workspace:^",
"@kong/design-tokens": "^1.12.1",
"@kong/design-tokens": "1.12.3",
"@kong/kongponents": "9.0.0-alpha.73",
"axios": "^1.6.2",
"vue": "^3.3.11",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"devDependencies": {
"@kong-ui-public/copy-uuid": "workspace:^",
"@kong-ui-public/i18n": "workspace:^",
"@kong/design-tokens": "^1.12.1",
"@kong/design-tokens": "1.12.3",
"@kong/kongponents": "9.0.0-alpha.73",
"axios": "^1.6.2",
"vue": "^3.3.11",
Expand Down
2 changes: 1 addition & 1 deletion packages/entities/entities-consumer-groups/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"devDependencies": {
"@kong-ui-public/i18n": "workspace:^",
"@kong/design-tokens": "^1.12.1",
"@kong/design-tokens": "1.12.3",
"@kong/kongponents": "9.0.0-alpha.73",
"axios": "^1.6.2",
"vue": "^3.3.11",
Expand Down
2 changes: 1 addition & 1 deletion packages/entities/entities-consumers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"devDependencies": {
"@kong-ui-public/i18n": "workspace:^",
"@kong/design-tokens": "^1.12.1",
"@kong/design-tokens": "1.12.3",
"@kong/kongponents": "9.0.0-alpha.73",
"axios": "^1.6.2",
"vue": "^3.3.11",
Expand Down
2 changes: 1 addition & 1 deletion packages/entities/entities-gateway-services/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"devDependencies": {
"@kong-ui-public/i18n": "workspace:^",
"@kong/design-tokens": "^1.12.1",
"@kong/design-tokens": "1.12.3",
"@kong/kongponents": "9.0.0-alpha.73",
"axios": "^1.6.2",
"vue": "^3.3.11",
Expand Down
2 changes: 1 addition & 1 deletion packages/entities/entities-keys/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"devDependencies": {
"@kong-ui-public/copy-uuid": "workspace:^",
"@kong-ui-public/i18n": "workspace:^",
"@kong/design-tokens": "^1.12.1",
"@kong/design-tokens": "1.12.3",
"@kong/kongponents": "9.0.0-alpha.73",
"axios": "^1.6.2",
"vue": "^3.3.11",
Expand Down
2 changes: 1 addition & 1 deletion packages/entities/entities-keys/src/components/KeyForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ onBeforeMount(async () => {
}
.invalid-key-set-message {
color: $kui-color-background-danger;
color: $kui-color-text-danger;
font-size: 11px;
font-weight: 500;
margin-top: 3px !important;
Expand Down
2 changes: 1 addition & 1 deletion packages/entities/entities-plugins/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"devDependencies": {
"@kong-ui-public/i18n": "workspace:^",
"@kong/design-tokens": "^1.12.1",
"@kong/design-tokens": "1.12.3",
"@kong/kongponents": "9.0.0-alpha.73",
"axios": "^1.6.2",
"vue": "^3.3.11",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ defineProps({
<style lang="scss" scoped>
.plugin-card-skeleton {
:deep(.skeleton-card-column) {
/* stylelint-disable-next-line @kong/design-tokens/use-proper-token */
width: calc(25% - $kui-space-70);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/entities/entities-routes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"devDependencies": {
"@kong-ui-public/i18n": "workspace:^",
"@kong/design-tokens": "^1.12.1",
"@kong/design-tokens": "1.12.3",
"@kong/kongponents": "9.0.0-alpha.73",
"axios": "^1.6.2",
"vue": "^3.3.11",
Expand Down
2 changes: 1 addition & 1 deletion packages/entities/entities-shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"devDependencies": {
"@kong-ui-public/i18n": "workspace:^",
"@kong/design-tokens": "^1.12.1",
"@kong/design-tokens": "1.12.3",
"@kong/kongponents": "9.0.0-alpha.73",
"axios": "^1.6.2",
"vue": "^3.3.11",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,15 @@ fieldset {
height: fit-content;
margin-bottom: $kui-space-60;
position: sticky;
top: $kui-space-60;
top: 16px;
}
}
.form-section-title {
color: $kui-color-text;
font-size: $kui-font-size-50;
font-weight: 600;
line-height: $kui-line_height-40;
line-height: $kui-line-height-40;
margin-bottom: $kui-space-40;
margin-top: 0;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/entities/entities-snis/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"devDependencies": {
"@kong-ui-public/i18n": "workspace:^",
"@kong/design-tokens": "^1.12.1",
"@kong/design-tokens": "1.12.3",
"@kong/kongponents": "9.0.0-alpha.73",
"axios": "^1.6.2",
"vue": "^3.3.11",
Expand Down
2 changes: 1 addition & 1 deletion packages/entities/entities-upstreams-targets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"devDependencies": {
"@kong-ui-public/i18n": "workspace:^",
"@kong/design-tokens": "^1.12.1",
"@kong/design-tokens": "1.12.3",
"@kong/kongponents": "9.0.0-alpha.73",
"axios": "^1.6.2",
"vue": "^3.3.11",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ watch(() => props.targetId, () => {
.target-form-info :deep(p) {
color: $kui-color-text;
font-size: $kui-font-size-30;
line-height: $kui-space-80;
line-height: $kui-line-height-30;
margin-bottom: $kui-space-90;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/entities/entities-vaults/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"devDependencies": {
"@kong-ui-public/i18n": "workspace:^",
"@kong/design-tokens": "^1.12.1",
"@kong/design-tokens": "1.12.3",
"@kong/kongponents": "9.0.0-alpha.73",
"axios": "^1.6.2",
"vue": "^3.3.11",
Expand Down
2 changes: 1 addition & 1 deletion packages/portal/document-viewer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"vue": "^3.3.11"
},
"devDependencies": {
"@kong/design-tokens": "^1.12.1",
"@kong/design-tokens": "1.12.3",
"@kong/kongponents": "9.0.0-alpha.73",
"@types/prismjs": "^1.26.3",
"@vitejs/plugin-vue-jsx": "^3.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/portal/spec-renderer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"vue": "^3.3.11"
},
"devDependencies": {
"@kong/design-tokens": "^1.12.1",
"@kong/design-tokens": "1.12.3",
"@kong/kongponents": "9.0.0-alpha.73",
"@modyfi/vite-plugin-yaml": "^1.0.4",
"@types/lodash.clonedeep": "^4.5.9",
Expand Down
Loading

0 comments on commit 0d6b971

Please sign in to comment.