Skip to content

Commit 8028f36

Browse files
committed
feat(HCM): a few more tweaks
1 parent 29da778 commit 8028f36

File tree

16 files changed

+119
-112
lines changed

16 files changed

+119
-112
lines changed

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,6 @@
177177
opacity: 1;
178178
transform: rotate(0);
179179
transition: transform $transition--base $carbon--standard-easing;
180-
<<<<<<< HEAD
181-
=======
182-
fill: $icon-primary;
183-
>>>>>>> f44269d77... feat(HCM): update more components
184180
}
185181

186182
//----------------------------------------------------------------------------

packages/components/src/components/number-input/_number-input.scss

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -447,12 +447,20 @@
447447
display: none;
448448
}
449449
}
450+
451+
// Windows HCM fixes
450452
/* stylelint-disable */
453+
.#{$prefix}--number__control-btn:hover,
454+
.#{$prefix}--number__control-btn:focus {
455+
@include high-contrast-mode('focus');
456+
}
457+
451458
.#{$prefix}--number__control-btn {
452459
@include high-contrast-mode('outline');
453-
&:focus {
454-
@include high-contrast-mode('focus');
455-
}
460+
}
461+
462+
.#{$prefix}--number__control-btn svg {
463+
@include high-contrast-mode('icon-fill');
456464
}
457465
/* stylelint-enable */
458466
}

packages/components/src/components/overflow-menu/_overflow-menu.scss

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -336,19 +336,16 @@
336336
}
337337
}
338338

339-
// Windows HCM fix
339+
// Windows HCM fixes
340340
/* stylelint-disable */
341-
.#{$prefix}--overflow-menu {
342-
&:focus {
343-
@include high-contrast-mode('focus');
344-
}
345-
circle {
346-
@include high-contrast-mode('outline');
347-
}
348-
}
341+
.#{$prefix}--overflow-menu:focus,
349342
.#{$prefix}--overflow-menu-options__btn:focus {
350343
@include high-contrast-mode('focus');
351344
}
345+
346+
.#{$prefix}--overflow-menu svg {
347+
@include high-contrast-mode('icon-fill');
348+
}
352349
/*stylelint-enable */
353350
}
354351

packages/components/src/components/pagination/_pagination.scss

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,6 @@ $css--helpers: true;
165165
fill: $icon-primary;
166166
transition: outline $duration--fast-02 motion(standard, productive),
167167
background-color $duration--fast-02 motion(standard, productive);
168-
169-
// Windows, Firefox HCM Fix
170-
@media screen and (-ms-high-contrast: active),
171-
screen and (prefers-contrast) {
172-
// `ButtonText` is a CSS2 system color to help improve colors in HCM
173-
border: 1px solid transparent;
174-
}
175168
}
176169

177170
.#{$prefix}--pagination__button:focus,
@@ -207,6 +200,13 @@ $css--helpers: true;
207200
margin-right: 1rem;
208201
margin-bottom: 0;
209202
}
203+
204+
// Windows HCM fixes
205+
// stylelint-disable-next-line no-duplicate-selectors
206+
.#{$prefix}--pagination__button,
207+
.#{$prefix}--btn--ghost.#{$prefix}--pagination__button {
208+
@include high-contrast-mode('outline');
209+
}
210210
}
211211

212212
@include exports('pagination') {

packages/components/src/components/search/_search.scss

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,6 @@
121121
fill: $icon-secondary;
122122
pointer-events: none;
123123
transform: translateY(-50%);
124-
125-
// Windows, Firefox HCM Fix
126-
@media screen and (-ms-high-contrast: active),
127-
screen and (prefers-contrast) {
128-
// `ButtonText` is a CSS2 system color to help improve colors in HCM
129-
fill: ButtonText;
130-
}
131124
}
132125

133126
.#{$prefix}--search-close {
@@ -173,12 +166,6 @@
173166

174167
.#{$prefix}--search-close svg {
175168
fill: inherit;
176-
177-
// Firefox HCM Fix
178-
@media screen and (prefers-contrast) {
179-
// `ButtonText` is a CSS2 system color to help improve colors in HCM
180-
fill: ButtonText;
181-
}
182169
}
183170

184171
.#{$prefix}--search-close,
@@ -365,6 +352,12 @@
365352
.#{$prefix}--search-magnifier-icon {
366353
fill: $icon-secondary;
367354
}
355+
356+
// Windows HCM Fixes
357+
.#{$prefix}--search-close svg,
358+
.#{$prefix}--search-magnifier-icon {
359+
@include high-contrast-mode('icon-fill');
360+
}
368361
}
369362

370363
@include exports('search') {

packages/components/src/components/select/_select.scss

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -178,18 +178,6 @@
178178
color: $text-primary;
179179
}
180180

181-
// Override some Firefox user-agent styles
182-
@-moz-document url-prefix() {
183-
.#{$prefix}--select-option {
184-
background-color: $layer;
185-
color: $text-primary;
186-
}
187-
188-
.#{$prefix}--select-optgroup {
189-
color: $text-primary;
190-
}
191-
}
192-
193181
.#{$prefix}--select--inline {
194182
display: flex;
195183
flex-direction: row;
@@ -263,6 +251,12 @@
263251
.#{$prefix}--select.#{$prefix}--skeleton .#{$prefix}--select-input {
264252
display: none;
265253
}
254+
255+
// Windows HCM Fix
256+
// stylelint-disable-next-line no-duplicate-selectors
257+
.#{$prefix}--select__arrow {
258+
@include high-contrast-mode('icon-fill');
259+
}
266260
}
267261

268262
@include exports('select') {

packages/components/src/components/slider/_slider.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@
209209
pointer-events: none;
210210
}
211211

212+
// Windows HCM fixes
212213
/* stylelint-disable */
213214
.#{$prefix}--slider__thumb {
214215
@include high-contrast-mode('outline');

packages/components/src/components/structured-list/_structured-list.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@
189189
}
190190
}
191191

192+
// Windows HCM Fix
192193
.#{$prefix}--structured-list-input:checked
193194
+ .#{$prefix}--structured-list-td
194195
.#{$prefix}--structured-list-svg {

packages/components/src/components/tabs/_tabs.scss

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -845,12 +845,20 @@
845845
.#{$prefix}--tabs.#{$prefix}--skeleton .#{$prefix}--tabs-trigger svg {
846846
@include hidden;
847847
}
848+
}
848849

849-
.#{$prefix}--tabs--scrollable__nav-item
850-
.#{$prefix}--tabs__nav-item--selected
851-
.#{$prefix}--tabs--scrollable__nav-item--selected {
852-
@include high-contrast-mode('focus');
853-
}
850+
// Windows HCM Fixes
851+
.#{$prefix}--tabs--scrollable__nav-item
852+
.#{$prefix}--tabs__nav-item--selected
853+
.#{$prefix}--tabs--scrollable__nav-item--selected {
854+
@include high-contrast-mode('focus');
855+
}
856+
857+
// stylelint-disable-next-line no-duplicate-selectors
858+
.#{$prefix}--tabs--scrollable
859+
.#{$prefix}--tabs--scrollable__nav-item--disabled
860+
.#{$prefix}--tabs--scrollable__nav-link {
861+
@include high-contrast-mode('disabled');
854862
}
855863
}
856864

packages/components/src/components/tag/_tag.scss

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -221,13 +221,6 @@
221221
border-radius: 50%;
222222
box-shadow: inset 0 0 0 1px $focus;
223223
outline: none;
224-
225-
// Windows, Firefox HCM Fix
226-
@media screen and (-ms-high-contrast: active),
227-
screen and (prefers-contrast) {
228-
// `ButtonText` is a CSS2 system color to help improve colors in HCM
229-
outline: 1px solid ButtonText;
230-
}
231224
}
232225

233226
.#{$prefix}--tag--high-contrast .#{$prefix}--tag__close-icon:focus {
@@ -277,6 +270,22 @@
277270
}
278271
}
279272
}
273+
274+
// Windows HCM Fixes
275+
/* stylelint-disable */
276+
.#{$prefix}--tag {
277+
@include high-contrast-mode('outline');
278+
}
279+
280+
.#{$prefix}--tag__close-icon svg,
281+
.#{$prefix}--tag__custom-icon svg {
282+
@include high-contrast-mode('icon-fill');
283+
}
284+
285+
.#{$prefix}--tag__close-icon:focus {
286+
@include high-contrast-mode('focus');
287+
}
288+
/* stylelint-enable */
280289
}
281290

282291
@include exports('tags') {

packages/components/src/components/text-input/_text-input.scss

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,6 @@
123123
svg {
124124
fill: $icon-secondary;
125125
transition: fill $duration--fast-01 motion(standard, productive);
126-
127-
// Windows, Firefox HCM Fix
128-
@media screen and (-ms-high-contrast: active),
129-
screen and (prefers-contrast) {
130-
// `ButtonText` is a CSS2 system color to help improve colors in HCM
131-
fill: ButtonText;
132-
}
133126
}
134127
}
135128

@@ -357,6 +350,15 @@
357350
flex: 8;
358351
flex-direction: column;
359352
}
353+
354+
// Windows HCM Fix
355+
.#{$prefix}--text-input--password__visibility,
356+
// TODO: remove selector above
357+
.#{$prefix}--btn.#{$prefix}--btn--icon-only.#{$prefix}--text-input--password__visibility__toggle.#{$prefix}--tooltip__trigger svg,
358+
.#{$prefix}--btn.#{$prefix}--btn--icon-only.#{$prefix}--text-input--password__visibility__toggle.#{$prefix}--tooltip__trigger:hover
359+
svg {
360+
@include high-contrast-mode('icon-fill');
361+
}
360362
}
361363

362364
@include exports('text-input') {

packages/components/src/components/tile/_tile.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,13 @@
283283
.#{$prefix}--tile--disabled .#{$prefix}--tile__checkmark svg {
284284
fill: $icon-disabled;
285285
}
286+
287+
// Windows HCM Fix
288+
.#{$prefix}--tile__chevron svg,
289+
.#{$prefix}--tile__checkmark svg,
290+
.#{$prefix}--tile--is-selected .#{$prefix}--tile__checkmark svg {
291+
@include high-contrast-mode('icon-fill');
292+
}
286293
}
287294

288295
@include exports('tile') {

packages/components/src/components/toggle/_toggle.scss

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,6 @@
296296
transition: box-shadow $duration--fast-01 motion(exit, productive),
297297
background-color $duration--fast-01 motion(exit, productive);
298298
will-change: box-shadow;
299-
300-
@include high-contrast-mode('outline');
301299
}
302300

303301
// Toggle circle
@@ -313,8 +311,6 @@
313311
border-radius: 50%;
314312
content: '';
315313
transition: transform $duration--fast-01 motion(exit, productive);
316-
317-
@include high-contrast-mode('outline');
318314
}
319315

320316
.#{$prefix}--toggle-input__label & {
@@ -463,6 +459,22 @@
463459
margin-bottom: $carbon--spacing-03;
464460
}
465461
}
462+
463+
// Windows HCM fixes
464+
.#{$prefix}--toggle__switch::after,
465+
.#{$prefix}--toggle__switch::before {
466+
@include high-contrast-mode('outline');
467+
}
468+
469+
// stylelint-disable-next-line no-duplicate-selectors
470+
.#{$prefix}--toggle-input:focus
471+
+ .#{$prefix}--toggle-input__label
472+
> .#{$prefix}--toggle__switch::before,
473+
.#{$prefix}--toggle-input:active
474+
+ .#{$prefix}--toggle-input__label
475+
> .#{$prefix}--toggle__switch::before {
476+
@include high-contrast-mode('focus');
477+
}
466478
}
467479

468480
@include exports('toggle') {

packages/components/src/components/tooltip/_tooltip.scss

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -690,18 +690,16 @@
690690
pointer-events: all;
691691
}
692692

693+
// Windows HCM Fixes
693694
/* stylelint-disable */
694-
.#{$prefix}--tooltip__trigger {
695-
svg {
696-
@include high-contrast-mode('icon-fill');
697-
}
698-
&:hover,
699-
&:focus {
700-
svg {
701-
@include high-contrast-mode('icon-fill');
702-
@include high-contrast-mode('focus');
703-
}
704-
}
695+
.#{$prefix}--tooltip__trigger svg,
696+
.#{$prefix}--tooltip__trigger:hover svg,
697+
.#{$prefix}--tooltip__trigger:focus svg {
698+
@include high-contrast-mode('icon-fill');
699+
}
700+
701+
.#{$prefix}--tooltip__trigger:focus svg {
702+
@include high-contrast-mode('focus');
705703
}
706704

707705
.#{$prefix}--tooltip {

packages/components/src/components/ui-shell/_header.scss

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,6 @@
6666
.#{$prefix}--header__action:focus {
6767
border-color: $shell-header-focus;
6868
outline: none;
69-
70-
// Firefox HCM Fix
71-
@media screen and (prefers-contrast) {
72-
border-style: dotted;
73-
}
7469
}
7570

7671
.#{$prefix}--header__action:active {
@@ -127,13 +122,6 @@
127122

128123
a.#{$prefix}--header__name:focus {
129124
border-color: $shell-header-focus;
130-
131-
// Windows, Firefox HCM Fix
132-
@media screen and (-ms-high-contrast: active),
133-
screen and (prefers-contrast) {
134-
// `ButtonText` is a CSS2 system color to help improve colors in HCM
135-
border-style: dotted;
136-
}
137125
}
138126

139127
.#{$prefix}--header__name--prefix {
@@ -221,12 +209,6 @@
221209
border-color: $shell-header-focus;
222210
color: $shell-header-text-01;
223211
outline: none;
224-
225-
// Windows, Firefox HCM Fix
226-
@media screen and (-ms-high-contrast: active),
227-
screen and (prefers-contrast) {
228-
border-style: dotted;
229-
}
230212
}
231213

232214
a.#{$prefix}--header__menu-item:hover > svg,

0 commit comments

Comments
 (0)