Skip to content

Commit 99c692a

Browse files
committed
feat: migration of tokens to spectrum 2
Expanding the existing themes system to support the new S2 mappings. --- Co-authored-by: castastrophe <[email protected]> Co-authored-by: Patrick Fulton <[email protected]> Co-authored-by: Cory Dransfeldt <[email protected]> Co-authored-by: Aziz Ramos <[email protected]> Co-authored-by: Josh Winn <[email protected]> Co-authored-by: Rise Erpelding <[email protected]> Co-authored-by: Marissa Huysentruyt <[email protected]> Co-authored-by: Rajdeep Chandra <[email protected]> Co-authored-by: TarunAdobe <[email protected]> Co-authored-by: Dragan Eror<[email protected]>
1 parent 3d2f1c8 commit 99c692a

File tree

5 files changed

+90
-16
lines changed

5 files changed

+90
-16
lines changed

components/calendar/dist/metadata.json

+15-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
".spectrum-Calendar-body",
77
".spectrum-Calendar-date",
88
".spectrum-Calendar-date.is-disabled",
9+
".spectrum-Calendar-date.is-disabled.is-range-selection",
910
".spectrum-Calendar-date.is-disabled.is-selected",
1011
".spectrum-Calendar-date.is-focused",
1112
".spectrum-Calendar-date.is-focused.is-range-selection",
@@ -31,6 +32,7 @@
3132
".spectrum-Calendar-date.is-range-selection.is-selection-start.is-selection-end",
3233
".spectrum-Calendar-date.is-range-selection.is-selection-start:after",
3334
".spectrum-Calendar-date.is-range-selection.is-selection-start:before",
35+
".spectrum-Calendar-date.is-range-selection.is-today",
3436
".spectrum-Calendar-date.is-range-selection:hover",
3537
".spectrum-Calendar-date.is-selected",
3638
".spectrum-Calendar-date.is-selected:hover:not(.is-selection-end, .is-selection-start)",
@@ -183,20 +185,32 @@
183185
"--mod-actionbutton-min-width"
184186
],
185187
"high-contrast": [
188+
"--highcontrast-calendar-button-icon-color",
186189
"--highcontrast-calendar-day-background-cap-selected",
190+
"--highcontrast-calendar-day-background-color-cap-selected",
191+
"--highcontrast-calendar-day-background-color-down",
192+
"--highcontrast-calendar-day-background-color-hover",
193+
"--highcontrast-calendar-day-background-color-key-focus",
194+
"--highcontrast-calendar-day-background-color-selected",
195+
"--highcontrast-calendar-day-background-color-selected-hover",
187196
"--highcontrast-calendar-day-background-down",
188197
"--highcontrast-calendar-day-background-focus",
189198
"--highcontrast-calendar-day-background-hover",
190199
"--highcontrast-calendar-day-background-selected",
191200
"--highcontrast-calendar-day-background-selected-hover",
192201
"--highcontrast-calendar-day-border-color-focus",
202+
"--highcontrast-calendar-day-border-color-key-focus",
193203
"--highcontrast-calendar-day-text-color-cap-selected",
204+
"--highcontrast-calendar-day-text-color-disabled",
194205
"--highcontrast-calendar-day-text-color-hover",
195206
"--highcontrast-calendar-day-text-color-key-focus",
196207
"--highcontrast-calendar-day-text-color-selected",
197208
"--highcontrast-calendar-day-title-text-color",
209+
"--highcontrast-calendar-day-today-background-color-selected-hover",
198210
"--highcontrast-calendar-day-today-background-selected-hover",
199211
"--highcontrast-calendar-day-today-border-color",
200-
"--highcontrast-calendar-day-today-text-color"
212+
"--highcontrast-calendar-day-today-border-color-disabled",
213+
"--highcontrast-calendar-day-today-text-color",
214+
"--highcontrast-calendar-day-today-text-color-disabled"
201215
]
202216
}

components/calendar/index.css

+53
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,59 @@
1313

1414
@import "./themes/spectrum-two.css";
1515

16+
@media (forced-colors: active) {
17+
.spectrum-Calendar-prevMonth,
18+
.spectrum-Calendar-nextMonth {
19+
--highcontrast-calendar-button-icon-color: ButtonText;
20+
}
21+
22+
.spectrum-Calendar-date {
23+
--highcontrast-calendar-day-background-color-cap-selected: Highlight;
24+
--highcontrast-calendar-day-background-color-down: ButtonFace;
25+
--highcontrast-calendar-day-background-color-hover: Transparent;
26+
--highcontrast-calendar-day-background-color-key-focus: ButtonFace;
27+
--highcontrast-calendar-day-background-color-selected-hover: Transparent;
28+
--highcontrast-calendar-day-background-color-selected: Highlight;
29+
--highcontrast-calendar-day-border-color-key-focus: ButtonText;
30+
--highcontrast-calendar-day-text-color-cap-selected: HighlightText;
31+
--highcontrast-calendar-day-text-color-disabled: GrayText;
32+
--highcontrast-calendar-day-text-color-hover: ButtonText;
33+
--highcontrast-calendar-day-text-color-key-focus: ButtonText;
34+
--highcontrast-calendar-day-text-color-selected: HighlightText;
35+
--highcontrast-calendar-day-title-text-color: CanvasText;
36+
--highcontrast-calendar-day-today-background-color-selected-hover: Highlight;
37+
--highcontrast-calendar-day-today-border-color-disabled: GrayText;
38+
--highcontrast-calendar-day-today-border-color: ButtonText;
39+
--highcontrast-calendar-day-today-text-color-disabled: GrayText;
40+
--highcontrast-calendar-day-today-text-color: ButtonText;
41+
42+
forced-color-adjust: none;
43+
44+
&.is-range-selection {
45+
&.is-today {
46+
color: HighlightText;
47+
}
48+
49+
&.is-selection-start::after,
50+
&.is-selection-end::after {
51+
content: none;
52+
}
53+
}
54+
55+
&.is-disabled {
56+
&.is-range-selection {
57+
background: Highlight;
58+
color: HighlightText;
59+
}
60+
61+
&.is-selected {
62+
background: Highlight;
63+
color: HighlightText;
64+
}
65+
}
66+
}
67+
}
68+
1669
.spectrum-Calendar {
1770
--spectrum-calendar-day-width: var(--mod-calendar-day-width, var(--spectrum-component-height-100));
1871
--spectrum-calendar-day-height: var(--mod-calendar-day-height, var(--spectrum-component-height-100));

components/combobox/themes/spectrum.css

+2
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,5 @@
2727
--spectrum-combobox-border-color-disabled: transparent;
2828
}
2929
}
30+
31+
@import "./spectrum-two.css";

components/progressbar/index.css

+12-14
Original file line numberDiff line numberDiff line change
@@ -98,21 +98,7 @@
9898
&:lang(ko) {
9999
--mod-progressbar-line-height: var(--spectrum-progressbar-line-height-cjk);
100100
}
101-
}
102-
103-
@media (forced-colors: active) {
104-
.spectrum-ProgressBar {
105-
--highcontrast-progressbar-fill-color: ButtonText;
106-
--highcontrast-progressbar-track-color: ButtonFace;
107-
}
108-
109-
.spectrum-ProgressBar-track {
110-
forced-color-adjust: none;
111-
border: 1px solid ButtonText;
112-
}
113-
}
114101

115-
.spectrum-ProgressBar {
116102
position: relative;
117103
display: inline-flex;
118104
flex-flow: row wrap;
@@ -205,6 +191,18 @@
205191
}
206192
}
207193

194+
@media (forced-colors: active) {
195+
.spectrum-ProgressBar {
196+
--highcontrast-progressbar-fill-color: ButtonText;
197+
--highcontrast-progressbar-track-color: ButtonFace;
198+
}
199+
200+
.spectrum-ProgressBar-track {
201+
forced-color-adjust: none;
202+
border: 1px solid ButtonText;
203+
}
204+
}
205+
208206
@keyframes indeterminate-loop {
209207
from {
210208
transform: translate(calc(-1 * var(--spectrum-progressbar-dir-indeterminate-multiplier) * var(--spectrum-progressbar-fill-size-indeterminate)));

components/stepper/index.css

+8-1
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@
9090
--spectrum-stepper-height: var(--mod-stepper-height, var(--spectrum-component-height-75));
9191
}
9292

93+
&,
94+
&.spectrum-Stepper--sizeM {
95+
--spectrum-stepper-button-width: var(--spectrum-in-field-button-width-stacked-medium);
96+
--spectrum-stepper-height: var(--spectrum-component-height-100);
97+
}
98+
9399
&.spectrum-Stepper--sizeL {
94100
--spectrum-stepper-button-width: var(--mod-stepper-button-width, var(--spectrum-in-field-button-width-stacked-large));
95101
--spectrum-stepper-height: var(--mod-stepper-height, var(--spectrum-component-height-200));
@@ -315,12 +321,13 @@
315321
transition: border-color var(--spectrum-stepper-animation-duration) ease-in-out;
316322
}
317323

318-
/* stylelint-disable-next-line selector-class-pattern -- @todo update hide-stepper class to standard variant syntax */
324+
/* stylelint-disable selector-class-pattern -- @todo update hide-stepper class to standard variant syntax */
319325
.spectrum-Stepper.hide-stepper .spectrum-Stepper-input {
320326
border-start-end-radius: var(--spectrum-stepper-border-radius);
321327
border-end-end-radius: var(--spectrum-stepper-border-radius);
322328
border-inline-end-width: var(--mod-stepper-border-width, var(--spectrum-stepper-border-width));
323329
}
330+
/* stylelint-enable selector-class-pattern */
324331

325332
/* --- Quiet variant styles --- */
326333
.spectrum-Stepper--quiet {

0 commit comments

Comments
 (0)