Skip to content

Commit 077f061

Browse files
committed
feat(checkbox): restoring new s2 tokens
1 parent 9e13cb7 commit 077f061

File tree

2 files changed

+20
-13
lines changed

2 files changed

+20
-13
lines changed

components/checkbox/dist/metadata.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@
146146
"--spectrum-checkbox-control-size",
147147
"--spectrum-checkbox-control-size-extra-large",
148148
"--spectrum-checkbox-control-size-large",
149+
"--spectrum-checkbox-control-size-medium",
149150
"--spectrum-checkbox-control-size-small",
150151
"--spectrum-checkbox-emphasized-color-default",
151152
"--spectrum-checkbox-emphasized-color-down",
@@ -184,6 +185,7 @@
184185
"--spectrum-component-bottom-to-text-200",
185186
"--spectrum-component-bottom-to-text-300",
186187
"--spectrum-component-bottom-to-text-75",
188+
"--spectrum-component-height-100",
187189
"--spectrum-component-height-200",
188190
"--spectrum-component-height-300",
189191
"--spectrum-component-height-75",
@@ -196,6 +198,7 @@
196198
"--spectrum-component-top-to-text-75",
197199
"--spectrum-corner-radius-small-size-extra-large",
198200
"--spectrum-corner-radius-small-size-large",
201+
"--spectrum-corner-radius-small-size-medium",
199202
"--spectrum-corner-radius-small-size-small",
200203
"--spectrum-disabled-content-color",
201204
"--spectrum-focus-indicator-color",

components/checkbox/index.css

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,13 @@
5454
/* Font */
5555
--spectrum-checkbox-line-height: var(--spectrum-line-height-100);
5656
--spectrum-checkbox-line-height-cjk: var(--spectrum-cjk-line-height-100);
57+
--spectrum-checkbox-text-font-weight: var(--spectrum-regular-font-weight);
58+
--spectrum-checkbox-text-font-style: var(--spectrum-default-font-style);
5759

60+
/* Size */
61+
--spectrum-checkbox-height: var(--spectrum-component-height-100);
62+
--spectrum-checkbox-control-size: var(--spectrum-checkbox-control-size-medium);
63+
--spectrum-checkbox-control-corner-radius: var(--spectrum-corner-radius-small-size-medium);
5864

5965
--spectrum-checkbox-focus-indicator-gap: var(--spectrum-focus-indicator-gap);
6066
--spectrum-checkbox-focus-indicator-thickness: var(--spectrum-focus-indicator-thickness);
@@ -63,6 +69,13 @@
6369
--spectrum-checkbox-selected-border-width: calc(var(--spectrum-checkbox-control-size) / 2);
6470

6571
--spectrum-checkbox-animation-duration: var(--spectrum-animation-duration-100);
72+
73+
/* CJK (Chinese, Japanese, and Korean) language support */
74+
&:lang(ja),
75+
&:lang(zh),
76+
&:lang(ko) {
77+
line-height: var(--mod-checkbox-line-height-cjk, var(--spectrum-checkbox-line-height-cjk));
78+
}
6679
}
6780

6881
.spectrum-Checkbox,
@@ -161,7 +174,7 @@
161174

162175
&:not(.is-readOnly):active {
163176
.spectrum-Checkbox-input:not(:disabled) + .spectrum-Checkbox-box {
164-
transform: perspective(var(--spectrum-component-size-minimum-perspective-down)) translateZ(var(--spectrum-component-size-difference-down)) scale(var(--spectrum-component-size-width-ratio-down), var(--spectrum-component-size-width-ratio-down));
177+
transform: perspective(var(--spectrum-component-size-minimum-perspective-down)) translateZ(var(--spectrum-component-size-difference-down));
165178
}
166179
}
167180

@@ -182,8 +195,7 @@
182195
}
183196

184197
&:hover {
185-
.spectrum-Checkbox-input:checked + .spectrum-Checkbox-box,
186-
.spectrum-Checkbox-box::before {
198+
.spectrum-Checkbox-input:checked + .spectrum-Checkbox-box::before {
187199
border-color: var(--highcontrast-checkbox-color-hover, var(--mod-checkbox-invalid-color-hover, var(--spectrum-checkbox-invalid-color-hover)));
188200
}
189201
}
@@ -365,20 +377,12 @@
365377
margin-block-end: var(--mod-checkbox-bottom-to-text, var(--spectrum-checkbox-bottom-to-text));
366378

367379
font-size: var(--mod-checkbox-font-size, var(--spectrum-checkbox-font-size));
368-
369-
/* TODO Use font-weight and font-style tokens */
370-
/* font-weight: var(--spectrum-checkbox-text-font-weight); */
371-
/* font-style: var(--spectrum-checkbox-text-font-style); */
380+
font-weight: var(--spectrum-checkbox-text-font-weight);
381+
font-style: var(--spectrum-checkbox-text-font-style);
372382

373383
transition: color var(--mod-checkbox-animation-duration, var(--spectrum-checkbox-animation-duration)) ease-in-out;
374384

375385
line-height: var(--mod-checkbox-line-height, var(--spectrum-checkbox-line-height));
376-
377-
&:lang(ja),
378-
&:lang(zh),
379-
&:lang(ko) {
380-
line-height: var(--mod-checkbox-line-height-cjk, var(--spectrum-checkbox-line-height-cjk));
381-
}
382386
}
383387

384388
/**

0 commit comments

Comments
 (0)