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

fix(tokens)!: correct space and size tokens #10727

Merged
merged 31 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
05a36b9
chore(token-transformer): add pxToRem helper
alisonailea Nov 14, 2024
ad370c4
fix(size): align core token size “category” with “type”
alisonailea Nov 14, 2024
16da23c
fix(size)!: correct size tokens
alisonailea Nov 14, 2024
844c145
fix(space)!: correct space tokens
alisonailea Nov 14, 2024
11154f1
test(tokens): update snapshot
alisonailea Nov 14, 2024
9af6d1d
fix(tokens): remove extra fixed size tokens
alisonailea Nov 14, 2024
d6ea2c2
fix(tokens): remove extra fixed size tokens
alisonailea Nov 14, 2024
2569cfb
test(tokens): update snapshot
alisonailea Nov 14, 2024
e53910a
fix(tokens): update size tokens to match new uikit
alisonailea Nov 16, 2024
aad4a43
test(tokens): update snapshot
alisonailea Nov 16, 2024
2cc449e
Merge branch 'dev' of github.com:Esri/calcite-design-system into ali-…
alisonailea Nov 20, 2024
f736f8f
chore(tokens): revert “space” token name for “spacing”
alisonailea Nov 20, 2024
7740cc9
chore(tokens): add style-dictionary valuetToUnitless helper
alisonailea Nov 20, 2024
953ed86
test(tokens): update snapshot
alisonailea Nov 21, 2024
533b9e9
Merge branch 'dev' of github.com:Esri/calcite-design-system into astu…
alisonailea Nov 25, 2024
b385606
chore(custom-theme): revert to dev
alisonailea Nov 26, 2024
e266f96
Merge branch 'dev' of github.com:Esri/calcite-design-system into astu…
alisonailea Nov 26, 2024
7bc42ee
Merge branch 'dev' into astump/10012-10014-space-size-tokens
alisonailea Nov 26, 2024
e117a2b
fix(legacy, action, card-group, date-picker-month-header, date-picker…
alisonailea Nov 27, 2024
0fcf249
fix(card-group, date-picker-month-header, panel): resolve misreferenc…
alisonailea Nov 27, 2024
24b7461
Merge branch 'dev' into astump/10012-10014-space-size-tokens
alisonailea Nov 27, 2024
69d41fe
fix(panel): update space tokens
alisonailea Nov 27, 2024
c651f7b
Merge branch 'astump/10012-10014-space-size-tokens' of github.com:Esr…
alisonailea Nov 27, 2024
4ad7326
fix(panel): resolve token
alisonailea Nov 27, 2024
3302076
fix(panel): token values
alisonailea Nov 27, 2024
2085fd8
fix(action-group): set missing border
alisonailea Nov 27, 2024
f18208b
fix(panel): tokens
alisonailea Nov 27, 2024
2a1e590
fix(scrim): remove unnecessary token assignment
alisonailea Nov 27, 2024
3fd82a1
fix(panel): tokens
alisonailea Nov 27, 2024
18eb8ea
Revert "fix(panel): tokens"
alisonailea Nov 27, 2024
96e2147
fix(panel): switch tokens to align with original values
alisonailea Nov 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions packages/calcite-components/src/assets/styles/_legacy.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,25 +49,25 @@
--calcite-app-breakpoint-width-xs: var(--calcite-container-size-width-xs-max);
--calcite-app-breakpoint-width-xxs: var(--calcite-container-size-width-xxs-max);
--calcite-app-spacing-11: var(--calcite-spacing-xxxl);
--calcite-app-spacing-8: var(--calcite-spacing-xxl);
--calcite-app-spacing-7: var(--calcite-spacing-xl);
--calcite-app-spacing-6: var(--calcite-spacing-lg);
--calcite-app-spacing-8: var(--calcite-spacing-xl);
--calcite-app-spacing-7: var(--calcite-spacing-lg);
--calcite-app-spacing-6: var(--calcite-spacing-md-plus);
--calcite-app-spacing-5: var(--calcite-spacing-md);
--calcite-app-spacing-3: var(--calcite-spacing-sm);
--calcite-app-spacing-2: var(--calcite-spacing-xs);
--calcite-app-spacing-1: var(--calcite-spacing-xxs);
--calcite-app-spacing-0: var(--calcite-spacing-base);
--calcite-app-sizing-11: var(--calcite-size-xxxl);
--calcite-app-sizing-9: var(--calcite-size-xxl);
--calcite-app-sizing-8: var(--calcite-size-xl);
--calcite-app-sizing-7: var(--calcite-size-lg);
--calcite-app-sizing-6: var(--calcite-size-md-plus);
--calcite-app-sizing-5: var(--calcite-size-md);
--calcite-app-sizing-4: var(--calcite-size-sm-plus);
--calcite-app-sizing-3: var(--calcite-size-sm);
--calcite-app-sizing-2: var(--calcite-size-xs);
--calcite-app-sizing-1: var(--calcite-size-xxs);
--calcite-app-sizing-0: var(--calcite-size-xxxs);
--calcite-app-sizing-11: var(--calcite-size-md);
--calcite-app-sizing-9: var(--calcite-size-sm);
--calcite-app-sizing-8: var(--calcite-spacing-xl);
--calcite-app-sizing-7: var(--calcite-size-xs);
--calcite-app-sizing-6: var(--calcite-size-xxxs-plus);
--calcite-app-sizing-5: var(--calcite-size-xxxs);
--calcite-app-sizing-4: var(--calcite-spacing-sm-plus);
--calcite-app-sizing-3: var(--calcite-spacing-sm);
--calcite-app-sizing-2: var(--calcite-spacing-xs);
--calcite-app-sizing-1: var(--calcite-spacing-xxs);
--calcite-app-sizing-0: var(--calcite-spacing-base);
--calcite-app-opacity-100: var(--calcite-app-opacity-full);
--calcite-app-opacity-85: var(--calcite-app-opacity-dark);
--calcite-app-opacity-50: var(--calcite-app-opacity-half);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,8 @@
}
}

:host([layout="horizontal"]) ::slotted(calcite-action-group) {
border-inline-end: var(--calcite-size-px);
}

@include base-component();
6 changes: 3 additions & 3 deletions packages/calcite-components/src/components/action/action.scss
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ button {
.button {
@apply text-n2h font-normal;
padding-inline: var(--calcite-internal-action-padding-inline, theme("spacing.2"));
padding-block: var(--calcite-internal-action-padding-block, var(--calcite-size-xxs));
padding-block: var(--calcite-internal-action-padding-block, var(--calcite-spacing-xxs));
}
.button--text-visible .icon-container {
margin-inline-end: theme("spacing.2");
Expand All @@ -186,7 +186,7 @@ button {
.button {
@apply text-n1h font-normal;
padding-inline: var(--calcite-internal-action-padding-inline, theme("spacing.4"));
padding-block: var(--calcite-internal-action-padding-block, var(--calcite-size-md));
padding-block: var(--calcite-internal-action-padding-block, var(--calcite-spacing-md));
}
.button--text-visible .icon-container {
margin-inline-end: theme("spacing.3");
Expand All @@ -197,7 +197,7 @@ button {
.button {
@apply text-0h font-normal;
padding-inline: var(--calcite-internal-action-padding-inline, theme("spacing.5"));
padding-block: var(--calcite-internal-action-padding-block, var(--calcite-size-xl));
padding-block: var(--calcite-internal-action-padding-block, var(--calcite-spacing-xl));
}
.button--text-visible .icon-container {
margin-inline-end: theme("spacing.4");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
.container {
display: flex;
flex-wrap: wrap;
gap: var(--calcite-card-group-space, var(--calcite-card-group-gap, var(--calcite-size-md)));
gap: var(--calcite-card-group-space, var(--calcite-card-group-gap, var(--calcite-spacing-base)));
}

@include base-component();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

:host([scale="s"]) {
block-size: #{$calcite-size-24};
margin: var(--calcite-size-xs);
margin-inline-start: var(--calcite-size-sm);
margin: var(--calcite-spacing-xs);
margin-inline-start: var(--calcite-spacing-sm);

.chevron-container,
.chevron {
Expand All @@ -28,27 +28,27 @@

:host([scale="m"]) {
block-size: #{$calcite-size-32};
margin: var(--calcite-size-sm);
margin-inline-start: var(--calcite-size-sm-plus);
margin: var(--calcite-spacing-sm);
margin-inline-start: var(--calcite-spacing-sm-plus);

.chevron-container,
.chevron {
min-inline-size: #{$calcite-size-32};
block-size: #{$calcite-size-32};
--calcite-internal-action-padding-block: var(--calcite-size-xxs);
--calcite-internal-action-padding-block: var(--calcite-spacing-xxs);
}
}

:host([scale="l"]) {
block-size: #{$calcite-size-44};
margin: var(--calcite-size-xs);
margin-inline-start: var(--calcite-size-sm);
margin: var(--calcite-spacing-xs);
margin-inline-start: var(--calcite-spacing-sm);

.chevron-container,
.chevron {
min-inline-size: #{$calcite-size-44};
block-size: #{$calcite-size-44};
--calcite-internal-action-padding-block: var(--calcite-size-sm-plus);
--calcite-internal-action-padding-block: var(--calcite-spacing-sm-plus);
}
}

Expand Down Expand Up @@ -93,7 +93,7 @@
justify-start
text-center
leading-none;
gap: var(--calcite-size-xxs);
gap: var(--calcite-spacing-xxs);
&.range-calendar {
@apply justify-center;
}
Expand All @@ -110,7 +110,7 @@
.year,
.suffix {
@apply bg-foreground-1;
margin-inline: var(--calcite-size-xxs);
margin-inline: var(--calcite-spacing-xxs);
font-weight: var(--calcite-font-weight-medium);
color: var(--calcite-color-text-1);
font-size: var(--calcite-font-size-md);
Expand Down Expand Up @@ -138,18 +138,18 @@
}

.month-select {
--calcite-select-spacing-inline: var(--calcite-size-xxs);
--calcite-internal-select-spacing-block: var(--calcite-size-xxs);
--calcite-internal-select-icon-container-padding-inline: var(--calcite-size-xxs);
--calcite-select-spacing-inline: var(--calcite-spacing-xxs);
--calcite-internal-select-spacing-block: var(--calcite-spacing-xxs);
--calcite-internal-select-icon-container-padding-inline: var(--calcite-spacing-xxs);
--calcite-select-font-size: var(--calcite-font-size-md);
--calcite-select-line-height: var(--calcite-font-line-height-fixed-lg);
}

:host([scale="s"]) .month-year-container {
.month-select {
--calcite-select-spacing-inline: var(--calcite-size-xxxs);
--calcite-internal-select-spacing-block: var(--calcite-size-xxxs);
--calcite-internal-select-icon-container-padding-inline: var(--calcite-size-xxxs);
--calcite-select-spacing-inline: var(--calcite-spacing-base);
--calcite-internal-select-spacing-block: var(--calcite-spacing-base);
--calcite-internal-select-icon-container-padding-inline: var(--calcite-spacing-base);
--calcite-internal-select-block-size: #{$calcite-size-24};
--calcite-select-font-size: var(--calcite-font-size);
--calcite-select-line-height: var(--calcite-font-line-height-fixed-base);
Expand All @@ -168,9 +168,9 @@

:host([scale="l"]) .month-year-container {
.month-select {
--calcite-select-spacing-inline: var(--calcite-size-sm);
--calcite-internal-select-spacing-block: var(--calcite-size-sm);
--calcite-internal-select-icon-container-padding-inline: var(--calcite-size-sm);
--calcite-select-spacing-inline: var(--calcite-spacing-sm);
--calcite-internal-select-spacing-block: var(--calcite-spacing-sm);
--calcite-internal-select-icon-container-padding-inline: var(--calcite-spacing-sm);
--calcite-internal-select-block-size: #{$calcite-size-44};
--calcite-select-font-size: var(--calcite-font-size-lg);
--calcite-select-line-height: var(--calcite-font-line-height-fixed-xl);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
calciteSizeXxxs,
calciteSizeXxs,
calciteSizeSm,
calciteSpacingBase,
calciteSpacingXxs,
calciteSpacingSm,
} from "@esri/calcite-design-tokens/dist/es6/global.js";
import { PropertyValues } from "lit";
import { createRef } from "lit-html/directives/ref.js";
Expand Down Expand Up @@ -352,15 +352,31 @@ export class DatePickerMonthHeader extends LitElement {
}
}

private getPx(value: string): string {
const num = Number(value.replace(/[rem|px]/g, ""));
const base = 16;

if (value.includes("rem")) {
return `${num * base}px`;
}

return `${num}px`;
}

private getYearSelectPadding(): string {
let padding;
switch (this.scale) {
case "l":
return calciteSizeSm;
padding = calciteSpacingSm;
break;
case "s":
return calciteSizeXxxs;
padding = calciteSpacingBase;
break;
default:
return calciteSizeXxs;
padding = calciteSpacingXxs;
break;
}
return this.getPx(padding);
}

// #endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
.week-header-container {
@apply flex;
block-size: #{$calcite-size-16};
padding-inline: var(--calcite-size-sm);
padding-block: var(--calcite-size-md);
padding-inline: var(--calcite-spacing-sm);
padding-block: var(--calcite-spacing-md);
}

.week-header {
Expand Down Expand Up @@ -44,8 +44,8 @@
@apply grid;
grid-template-columns: repeat(7, 1fr);
grid-auto-rows: 1fr;
padding-inline: var(--calcite-size-sm);
padding-block-end: var(--calcite-size-sm);
padding-inline: var(--calcite-spacing-sm);
padding-block-end: var(--calcite-spacing-sm);
}

.month-header {
Expand All @@ -62,12 +62,12 @@

:host([scale="s"]) {
.week-days {
padding-inline: var(--calcite-size-xs);
padding-block-end: var(--calcite-size-xs);
padding-inline: var(--calcite-spacing-xs);
padding-block-end: var(--calcite-spacing-xs);
}
.week-header-container {
padding-inline: var(--calcite-size-xs);
padding-block: var(--calcite-size-sm);
padding-inline: var(--calcite-spacing-xs);
padding-block: var(--calcite-spacing-sm);
}
.day {
font-size: var(--calcite-font-size-sm);
Expand All @@ -79,12 +79,12 @@
@apply text-n1h;
}
.week-days {
padding-inline: var(--calcite-size-md);
padding-block-end: var(--calcite-size-md);
padding-inline: var(--calcite-spacing-md);
padding-block-end: var(--calcite-spacing-md);
}
.week-header-container {
padding-inline: var(--calcite-size-md);
padding-block: var(--calcite-size-md-plus);
padding-inline: var(--calcite-spacing-md);
padding-block: var(--calcite-spacing-md-plus);
}
.day {
font-size: var(--calcite-font-size-md);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
}

:host([scale="l"]) {
--calcite-internal-dialog-content-padding: var(--calcite-dialog-content-space, var(--calcite-spacing-lg));
--calcite-internal-dialog-content-padding: var(--calcite-dialog-content-space, var(--calcite-spacing-md-plus));
--calcite-internal-dialog-min-size-x: 388px;
--calcite-internal-dialog-min-size-y: 220px;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@

.dropdown-item-icon,
.dropdown-item-icon--start {
padding-inline-end: var(--calcite-spacing-xl);
padding-inline-end: var(--calcite-spacing-lg);
}

.dropdown-item-icon--end {
padding-inline-start: var(--calcite-spacing-xl);
padding-inline-start: var(--calcite-spacing-lg);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@

.divider {
@apply inline-block w-px;
margin-block: var(--calcite-size-xxs);
margin-block: var(--calcite-spacing-xxs);
background-color: var(--calcite-color-border-2);
}

:host([layout="vertical"]) .divider-container {
@apply w-full h-px border-t-0 border-b-0 border-l border-r-0;
padding-inline: var(--calcite-size-md);
padding-inline: var(--calcite-spacing-md);
& .divider {
@apply w-full h-px my-0;
}
Expand Down Expand Up @@ -125,7 +125,7 @@

.vertical-chevron-container {
@apply flex items-center border border-solid border-color-input border-l-0;
padding-inline: var(--calcite-size-md);
padding-inline: var(--calcite-spacing-md);
background-color: var(--calcite-color-foreground-1);

calcite-icon {
Expand All @@ -140,14 +140,14 @@
:host([range][layout="vertical"][scale="s"]) {
.vertical-chevron-container,
.divider-container {
padding-inline: var(--calcite-size-sm);
padding-inline: var(--calcite-spacing-sm);
}
}

:host([range][layout="vertical"][scale="l"]) {
.vertical-chevron-container,
.divider-container {
padding-inline: var(--calcite-size-lg);
padding-inline: var(--calcite-spacing-lg);
}
}

Expand Down
8 changes: 4 additions & 4 deletions packages/calcite-components/src/components/panel/panel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

:host([scale="s"]) {
--calcite-internal-panel-default-space: var(--calcite-spacing-sm);
--calcite-internal-panel-header-vertical-padding: 10px; // this should use a spacing token once made available
--calcite-internal-panel-header-vertical-padding: var(--calcite-spacing-sm-plus);

.header-content {
.heading {
Expand All @@ -55,7 +55,7 @@

:host([scale="m"]) {
--calcite-internal-panel-default-space: var(--calcite-spacing-md);
--calcite-internal-panel-header-vertical-padding: var(--calcite-spacing-lg);
--calcite-internal-panel-header-vertical-padding: var(--calcite-spacing-md-plus);

.header-content {
.heading {
Expand All @@ -69,8 +69,8 @@
}

:host([scale="l"]) {
--calcite-internal-panel-default-space: var(--calcite-spacing-xl);
--calcite-internal-panel-header-vertical-padding: var(--calcite-spacing-xxl);
--calcite-internal-panel-default-space: var(--calcite-spacing-lg);
--calcite-internal-panel-header-vertical-padding: var(--calcite-spacing-xl);

.header-content {
.heading {
Expand Down
3 changes: 0 additions & 3 deletions packages/calcite-components/src/components/scrim/scrim.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
*
* @prop --calcite-scrim-background: Specifies the background color of the scrim.
*/
:host {
--calcite-scrim-background: var(--calcite-color-transparent-scrim);
}

:host {
@apply absolute
Expand Down
Loading
Loading