Skip to content

Commit 32c56b1

Browse files
committed
feat(HCM): update first half of components
1 parent f44269d commit 32c56b1

File tree

4 files changed

+44
-56
lines changed

4 files changed

+44
-56
lines changed

packages/components/src/components/file-uploader/_file-uploader.scss

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,6 @@
160160
white-space: nowrap;
161161
text-overflow: ellipsis;
162162
}
163-
164-
// Windows, Firefox HCM Fix
165-
@media screen and (-ms-high-contrast: active),
166-
screen and (prefers-contrast) {
167-
outline: 2px solid transparent;
168-
}
169163
}
170164

171165
.#{$prefix}--file__selected-file--field {
@@ -307,13 +301,6 @@
307301

308302
.#{$prefix}--file__state-container .#{$prefix}--file-close svg path {
309303
fill: $icon-primary;
310-
311-
// Windows, Firefox HCM Fix
312-
@media screen and (-ms-high-contrast: active),
313-
screen and (prefers-contrast) {
314-
// `ButtonText` is a CSS2 system color to help improve colors in HCM
315-
fill: ButtonText;
316-
}
317304
}
318305

319306
.#{$prefix}--file__state-container .#{$prefix}--inline-loading__animation {
@@ -335,6 +322,17 @@
335322
outline: 2px solid $focus;
336323
outline-offset: -2px;
337324
}
325+
326+
// Windows HCM fix
327+
/* stylelint-disable */
328+
.#{$prefix}--file__selected-file {
329+
@include high-contrast-mode('outline');
330+
}
331+
332+
.#{$prefix}--file__state-container .#{$prefix}--file-close svg path {
333+
@include high-contrast-mode('icon-fill');
334+
}
335+
/* stylelint-enable */
338336
}
339337

340338
@include exports('file-uploader') {

packages/components/src/components/modal/_modal.scss

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -330,14 +330,6 @@
330330
align-items: flex-start;
331331
}
332332

333-
.#{$prefix}--modal-footer button.#{$prefix}--btn:focus {
334-
// Firefox HCM Fix
335-
@media screen and (prefers-contrast) {
336-
border: none;
337-
outline-style: dotted;
338-
}
339-
}
340-
341333
.#{$prefix}--modal-close {
342334
position: absolute;
343335
top: 0;
@@ -358,11 +350,6 @@
358350
&:focus {
359351
border-color: $focus;
360352
outline: none;
361-
362-
// Firefox HCM Fix
363-
@media screen and (prefers-contrast) {
364-
border-style: dotted;
365-
}
366353
}
367354
}
368355

@@ -374,13 +361,6 @@
374361
width: rem(20px);
375362
height: rem(20px);
376363
fill: $icon-primary;
377-
378-
// Windows, Firefox HCM Fix
379-
@media screen and (-ms-high-contrast: active),
380-
screen and (prefers-contrast) {
381-
// `ButtonText` is a CSS2 system color to help improve colors in HCM
382-
fill: ButtonText;
383-
}
384364
}
385365

386366
.#{$prefix}--body--with-modal-open {
@@ -390,6 +370,17 @@
390370
.#{$prefix}--body--with-modal-open .#{$prefix}--tooltip {
391371
z-index: z('modal');
392372
}
373+
374+
// Windows HCM fixes
375+
/* stylelint-disable */
376+
.#{$prefix}--modal-close__icon {
377+
@include high-contrast-mode('icon-fill');
378+
}
379+
380+
.#{$prefix}--modal-close:focus {
381+
@include high-contrast-mode('focus');
382+
}
383+
/* stylelint-enable */
393384
}
394385

395386
@include exports('modal') {

packages/components/src/components/notification/_inline-notification.scss

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,6 @@
4949
@include carbon--breakpoint(max) {
5050
max-width: rem(832px);
5151
}
52-
53-
// Firefox HCM fix
54-
@media screen and (prefers-contrast) {
55-
outline-width: 1px;
56-
outline-style: solid;
57-
}
5852
}
5953

6054
.#{$prefix}--inline-notification:not(.#{$prefix}--inline-notification--low-contrast)
@@ -249,12 +243,6 @@
249243
outline: 2px solid $focus-inverse;
250244
outline-offset: -2px;
251245
box-shadow: none;
252-
253-
// Firefox HCM Fix
254-
@media screen and (prefers-contrast) {
255-
border-style: dotted;
256-
outline-style: dotted;
257-
}
258246
}
259247

260248
.#{$prefix}--inline-notification--low-contrast
@@ -291,11 +279,6 @@
291279
&:focus {
292280
outline: 2px solid $focus-inverse;
293281
outline-offset: -2px;
294-
295-
// Firefox HCM fix
296-
@media screen and (prefers-contrast) {
297-
outline-style: dotted;
298-
}
299282
}
300283

301284
.#{$prefix}--inline-notification__close-icon {
@@ -317,6 +300,17 @@
317300
.#{$prefix}--inline-notification__close-icon {
318301
fill: $icon-primary;
319302
}
303+
304+
// Windows HCM fixes
305+
// stylelint-disable-next-line no-duplicate-selectors
306+
.#{$prefix}--inline-notification {
307+
@include high-contrast-mode('outline');
308+
}
309+
310+
.#{$prefix}--inline-notification__close-button:focus,
311+
.#{$prefix}--btn.#{$prefix}--btn--ghost.#{$prefix}--inline-notification__action-button:focus {
312+
@include high-contrast-mode('focus');
313+
}
320314
}
321315

322316
@include exports('inline-notifications') {

packages/components/src/components/notification/_toast-notification.scss

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,6 @@
4242
@include carbon--breakpoint(max) {
4343
width: rem(352px);
4444
}
45-
46-
// Firefox HCM fix
47-
@media screen and (prefers-contrast) {
48-
outline-width: 1px;
49-
outline-style: solid;
50-
}
5145
}
5246

5347
.#{$prefix}--toast-notification:not(.#{$prefix}--toast-notification--low-contrast)
@@ -231,6 +225,17 @@
231225
.#{$prefix}--toast-notification__caption {
232226
color: $text-primary;
233227
}
228+
229+
// Windows HCM fixes
230+
/* stylelint-disable */
231+
.#{$prefix}--toast-notification {
232+
@include high-contrast-mode('outline');
233+
}
234+
235+
.#{$prefix}--toast-notification__close-button:focus {
236+
@include high-contrast-mode('focus');
237+
}
238+
/* stylelint-enable */
234239
}
235240

236241
@include exports('toast-notifications') {

0 commit comments

Comments
 (0)