Skip to content

Commit f44269d

Browse files
committed
feat(HCM): update more components
1 parent 658b4fa commit f44269d

File tree

9 files changed

+113
-134
lines changed

9 files changed

+113
-134
lines changed

packages/components/src/components/code-snippet/_code-snippet.scss

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,6 @@
7272
&:focus {
7373
border: 2px solid $focus;
7474
outline: none;
75-
76-
// Firefox HCM fix
77-
@media screen and (prefers-contrast) {
78-
border-style: dotted;
79-
}
8075
}
8176

8277
&::before {
@@ -142,12 +137,6 @@
142137
align-items: center;
143138
height: $carbon--spacing-08;
144139
padding-right: $carbon--spacing-08;
145-
146-
// Windows, Firefox HCM Fix
147-
@media screen and (-ms-high-contrast: active),
148-
screen and (prefers-contrast) {
149-
outline: 2px solid transparent;
150-
}
151140
}
152141

153142
.#{$prefix}--snippet--single.#{$prefix}--snippet--no-copy {
@@ -189,12 +178,6 @@
189178

190179
display: flex;
191180
padding: $carbon--spacing-05;
192-
193-
// Windows, Firefox HCM Fix
194-
@media screen and (-ms-high-contrast: active),
195-
screen and (prefers-contrast) {
196-
outline: 2px solid transparent;
197-
}
198181
}
199182

200183
//collapsed snippet container
@@ -260,13 +243,6 @@
260243
height: rem(16px);
261244
transition: all $duration--fast-01 motion(standard, productive);
262245
fill: $icon-primary;
263-
264-
// Windows, Firefox HCM Fix
265-
@media screen and (-ms-high-contrast: active),
266-
screen and (prefers-contrast) {
267-
// `ButtonText` is a CSS2 system color to help improve colors in HCM
268-
fill: ButtonText;
269-
}
270246
}
271247

272248
.#{$prefix}--snippet-button {
@@ -575,6 +551,22 @@
575551
.#{$prefix}--snippet-container {
576552
padding-bottom: 0;
577553
}
554+
555+
// Windows HCM fixes
556+
/* stylelint-disable */
557+
.#{$prefix}--snippet__icon {
558+
@include high-contrast-mode('icon-fill');
559+
}
560+
561+
.#{$prefix}--snippet--inline:focus {
562+
@include high-contrast-mode('focus');
563+
}
564+
565+
.#{$prefix}--snippet--single,
566+
.#{$prefix}--snippet--multi {
567+
@include high-contrast-mode('outline');
568+
}
569+
/* stylelint-enable */
578570
}
579571

580572
@include exports('snippet') {

packages/components/src/components/data-table/_data-table-core.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -957,6 +957,12 @@
957957
.#{$prefix}--form-item.#{$prefix}--checkbox-wrapper:last-of-type {
958958
margin: rem(-3px) 0;
959959
}
960+
961+
// Windows HCM fixes
962+
// stylelint-disable-next-line no-duplicate-selectors
963+
.#{$prefix}--data-table-content {
964+
@include high-contrast-mode('outline');
965+
}
960966
}
961967

962968
@include exports('data-table-v2-core') {

packages/components/src/components/data-table/_data-table-expandable.scss

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -207,25 +207,10 @@
207207
box-shadow: inset 0 0 0 2px $focus;
208208
}
209209

210-
.#{$prefix}--table-expand__button:focus .#{$prefix}--table-expand__svg {
211-
// Windows, Firefox HCM Fix
212-
@media screen and (-ms-high-contrast: active),
213-
screen and (prefers-contrast) {
214-
outline: 2px solid transparent;
215-
}
216-
}
217-
218210
.#{$prefix}--table-expand__svg {
219211
transform: rotate(90deg);
220212
transition: transform $duration--moderate-01 motion(standard, productive);
221213
fill: $ui-05;
222-
223-
// Windows, Firefox HCM Fix
224-
@media screen and (-ms-high-contrast: active),
225-
screen and (prefers-contrast) {
226-
// `ButtonText` is a CSS2 system color to help improve colors in HCM
227-
fill: ButtonText;
228-
}
229214
}
230215

231216
// V11: remove tall
@@ -393,6 +378,16 @@
393378
td {
394379
background: $layer-selected;
395380
}
381+
382+
// Windows HCM fixes
383+
.#{$prefix}--table-expand__button:focus .#{$prefix}--table-expand__svg {
384+
@include high-contrast-mode('focus');
385+
}
386+
387+
// stylelint-disable-next-line no-duplicate-selectors
388+
.#{$prefix}--table-expand__svg {
389+
@include high-contrast-mode('icon-fill');
390+
}
396391
}
397392

398393
@include exports('data-table-v2-expandable') {

packages/components/src/components/data-table/_data-table-sort.scss

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -179,16 +179,6 @@
179179
fill: $icon-primary;
180180
}
181181

182-
// Windows, Firefox HCM Fix
183-
.#{$prefix}--table-sort__icon,
184-
.#{$prefix}--table-sort__icon-unsorted {
185-
@media screen and (-ms-high-contrast: active),
186-
screen and (prefers-contrast) {
187-
// `ButtonText` is a CSS2 system color to help improve colors in HCM
188-
fill: ButtonText;
189-
}
190-
}
191-
192182
//----------------------------------------------------------------------------
193183
// Compact, Short, Tall Sortable
194184
//----------------------------------------------------------------------------
@@ -237,6 +227,12 @@
237227
.#{$prefix}--data-table--xl .#{$prefix}--table-sort__icon {
238228
margin-top: rem(13px);
239229
}
230+
231+
// Windows HCM fixes
232+
.#{$prefix}--table-sort__icon,
233+
.#{$prefix}--table-sort__icon-unsorted {
234+
@include high-contrast-mode('icon-fill');
235+
}
240236
}
241237

242238
@include exports('data-table-sort') {

packages/components/src/components/date-picker/_date-picker.scss

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,6 @@
137137
transform: translateY(-50%);
138138
cursor: pointer;
139139
fill: $icon-primary;
140-
141-
// Windows, Firefox HCM Fix
142-
@media screen and (-ms-high-contrast: active),
143-
screen and (prefers-contrast) {
144-
// `ButtonText` is a CSS2 system color to help improve colors in HCM
145-
fill: ButtonText;
146-
}
147140
}
148141

149142
.#{$prefix}--date-picker__icon--invalid,
@@ -202,6 +195,12 @@
202195
width: rem(75px);
203196
height: rem(14px);
204197
}
198+
199+
// Windows HCM fixes
200+
// stylelint-disable-next-line no-duplicate-selectors
201+
.#{$prefix}--date-picker__icon {
202+
@include high-contrast-mode('icon-fill');
203+
}
205204
}
206205

207206
@include exports('date-picker') {

packages/components/src/components/date-picker/_flatpickr.scss

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,6 @@
215215
&:hover {
216216
background-color: $hover-ui;
217217
}
218-
219-
// Windows, Firefox HCM Fix
220-
@media screen and (-ms-high-contrast: active), (prefers-contrast) {
221-
// `ButtonText` is a CSS2 system color to help improve colors in HCM
222-
fill: ButtonText;
223-
}
224218
}
225219

226220
.flatpickr-next-month.disabled svg,
@@ -522,4 +516,27 @@
522516
.flatpickr-input[readonly] {
523517
cursor: pointer;
524518
}
519+
520+
// Windows HCM fixes
521+
.flatpickr-prev-month,
522+
.flatpickr-next-month {
523+
@include high-contrast-mode('icon-fill');
524+
}
525+
526+
.flatpickr-day.selected {
527+
@include high-contrast-mode('focus') {
528+
outline-style: dotted;
529+
}
530+
}
531+
532+
.flatpickr-day.today,
533+
.flatpickr-day.inRange {
534+
@include high-contrast-mode {
535+
color: Highlight;
536+
}
537+
}
538+
539+
.flatpickr-calendar {
540+
@include high-contrast-mode('outline');
541+
}
525542
}

packages/components/src/components/dropdown/_dropdown.scss

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,6 @@
6767
// Menu's triggering element updated to button with Downshift v5 upgrade
6868
.#{$prefix}--dropdown .#{$prefix}--list-box__field {
6969
text-align: left;
70-
71-
// Windows, Firefox HCM Fix
72-
@media screen and (-ms-high-contrast: active),
73-
screen and (prefers-contrast) {
74-
border: 1px solid transparent;
75-
}
7670
}
7771

7872
// TODO V11: Remove xl selector
@@ -484,6 +478,22 @@
484478
.#{$prefix}--dropdown.#{$prefix}--skeleton {
485479
@include skeleton;
486480
}
481+
482+
// Windows HCM fix
483+
// stylelint-disable-next-line no-duplicate-selectors
484+
.#{$prefix}--dropdown .#{$prefix}--list-box__field {
485+
@include high-contrast-mode('outline');
486+
}
487+
488+
.#{$prefix}--list-box__menu-item__option {
489+
@include high-contrast-mode {
490+
outline: none;
491+
}
492+
}
493+
494+
.#{$prefix}--list-box__menu-item__selected-icon {
495+
@include high-contrast-mode('icon-fill');
496+
}
487497
}
488498

489499
@include exports('dropdown') {

0 commit comments

Comments
 (0)