Skip to content

Commit 75b8655

Browse files
authored
fix(skeleton): ensure visibility in Windows High Contrast Mode (#19961)
1 parent 3d8a8b1 commit 75b8655

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

packages/styles/scss/components/skeleton-styles/_ai-skeleton-styles.scss

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
@use '../../config' as *;
99
@use '../../theme';
1010
@use '../../utilities/convert';
11+
@use '../../utilities/high-contrast-mode' as *;
1112

1213
@keyframes ai-skeleton-animation {
1314
0% {
@@ -61,6 +62,22 @@
6162
.#{$prefix}--skeleton__icon--ai {
6263
border-radius: convert.to-rem(2px);
6364
}
65+
66+
//High Contrast Mode
67+
//Ensure AI Skeleton is visible and animated in Windows HCM
68+
@include high-contrast-mode {
69+
.#{$prefix}--skeleton__text--ai,
70+
.#{$prefix}--skeleton__placeholder--ai,
71+
.#{$prefix}--skeleton__icon--ai {
72+
background: CanvasText;
73+
}
74+
75+
.#{$prefix}--skeleton__text--ai::before,
76+
.#{$prefix}--skeleton__placeholder--ai::before,
77+
.#{$prefix}--skeleton__icon--ai::before {
78+
background: Canvas;
79+
}
80+
}
6481
}
6582

6683
// rgba($ai-skeleton-element-background, 1)

packages/styles/scss/utilities/_skeleton.scss

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
@use 'keyframes';
99
@use '../theme' as *;
1010
@use '../config' as *;
11+
@use '../utilities/high-contrast-mode' as *;
1112

1213
/// Skeleton loading animation
1314
/// @access public
@@ -43,6 +44,16 @@
4344
animation: none;
4445
}
4546
}
47+
48+
// High Contrast Mode support
49+
@include high-contrast-mode {
50+
background: CanvasText;
51+
52+
&::before {
53+
background: Canvas;
54+
forced-color-adjust: none;
55+
}
56+
}
4657
}
4758

4859
/// Circular Skeleton loading animation
@@ -68,4 +79,15 @@
6879
animation: none;
6980
}
7081
}
82+
83+
//High Contrast Mode
84+
//Ensure Skeleton is visible and animated in Windows HCM
85+
@include high-contrast-mode {
86+
background: CanvasText;
87+
88+
&::before {
89+
background: Canvas;
90+
forced-color-adjust: none;
91+
}
92+
}
7193
}

0 commit comments

Comments
 (0)