Skip to content

Commit 61556d4

Browse files
feat: add low/high contrast themes (#1041)
1 parent f29f0a7 commit 61556d4

30 files changed

+966
-2
lines changed

src/components/Avatar/avatar.module.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@
110110
.image-style,
111111
.avatar-img-wrapper {
112112
border-radius: var(--avatar-border-radius);
113+
border: var(--avatar-border);
113114
position: relative;
114115

115116
&.round {
@@ -133,6 +134,7 @@
133134
.wrapper-style {
134135
&:focus-visible {
135136
box-shadow: var(--focus-visible-box-shadow);
137+
@include focus-visible-forced-colors();
136138
}
137139
}
138140
}

src/components/Badge/badge.module.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
padding: 0 $space-xxs;
1010
width: fit-content;
1111
height: fit-content;
12+
forced-color-adjust: none; /* prevents system from overriding */
1213

1314
&-large {
1415
border-radius: calc(var(--badge-border-radius) + 2px);

src/components/Button/button.module.scss

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,10 @@
415415

416416
&.ai-agent {
417417
color: var(--button-ai-agent-text-color);
418+
border-width: var(--button-ai-agent-border-width);
419+
border-style: var(--button-ai-agent-border-style);
420+
border-color: var(--button-ai-agent-border-color);
421+
418422
&.focus-visible,
419423
&:focus-visible {
420424
outline: 2px solid var(--button-ai-agent-focus-visible-outline-color);
@@ -1356,6 +1360,9 @@
13561360
--color: var(--button-neutral-text-color);
13571361
color: var(--color);
13581362
background: var(--bg);
1363+
border-width: var(--button-neutral-border-width);
1364+
border-style: var(--button-neutral-border-style);
1365+
border-color: var(--button-neutral-border-color);
13591366

13601367
.loader-dot {
13611368
background: var(--color);
@@ -1380,6 +1387,9 @@
13801387
--bg: var(--button-system-ui-background-color);
13811388
--color: var(--button-system-ui-text-color);
13821389
color: var(--color);
1390+
border-width: var(--button-system-ui-border-width);
1391+
border-style: var(--button-system-ui-border-style);
1392+
border-color: var(--button-system-ui-border-color);
13831393

13841394
.loader-dot {
13851395
background: var(--color);
@@ -1554,6 +1564,9 @@
15541564
--color: var(--button-two-state-text-color);
15551565
background: var(--bg);
15561566
color: var(--color);
1567+
border-width: var(--button-two-state-border-width);
1568+
border-style: var(--button-two-state-border-style);
1569+
border-color: var(--button-two-state-border-color);
15571570

15581571
.loader {
15591572
background: var(--bg);
@@ -1892,6 +1905,7 @@
18921905
&.focus-visible,
18931906
&:focus-visible {
18941907
box-shadow: var(--focus-visible-box-shadow);
1908+
@include focus-visible-forced-colors();
18951909

18961910
&.drop-shadow {
18971911
box-shadow: var(--focus-visible-box-shadow), $shadow-object-s;

src/components/Card/card.module.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@
166166
&.focus-visible,
167167
&:focus-visible {
168168
box-shadow: var(--focus-visible-box-shadow);
169+
@include focus-visible-forced-colors();
169170

170171
&.drop-shadow {
171172
box-shadow: var(--focus-visible-box-shadow), $shadow-object-s;

src/components/CheckBox/checkbox.module.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -934,6 +934,7 @@
934934
background: var(--check-box-pill-container-active-background-color);
935935
box-shadow: var(--focus-visible-box-shadow);
936936
color: var(--check-box-pill-container-active-text-color);
937+
@include focus-visible-forced-colors();
937938

938939
input[type='checkbox'] {
939940
&:checked {

src/components/DateTimePicker/Internal/ocpicker.module.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2864,12 +2864,14 @@
28642864
&-focused {
28652865
border-color: transparent;
28662866
box-shadow: var(--focus-visible-box-shadow);
2867+
@include focus-visible-forced-colors();
28672868
}
28682869

28692870
&-partial {
28702871
&-focused {
28712872
border-color: transparent;
28722873
box-shadow: var(--focus-visible-box-shadow), $picker-box-shadow;
2874+
@include focus-visible-forced-colors();
28732875
}
28742876
}
28752877
}

src/components/Dialog/BaseDialog/base-dialog.module.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ $dialog-body-bottom-shadow: inset 0 -11px 8px -10px
2323
border-radius: $border-radius-xl;
2424
box-shadow: $shadow-object-l;
2525
opacity: 0;
26+
border: var(--dialog-border);
2627

2728
.header {
2829
display: flex;

src/components/Drawer/drawer.module.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ $handle_height: 40px;
179179
&.focus-visible,
180180
&:focus-visible {
181181
box-shadow: var(--focus-visible-box-shadow) inset;
182+
@include focus-visible-forced-colors();
182183
}
183184
}
184185
}

src/components/Dropdown/dropdown.module.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
&:focus-visible {
1212
outline: none;
1313
box-shadow: var(--focus-visible-box-shadow);
14+
@include focus-visible-forced-colors();
1415
}
1516

1617
&.disabled {
@@ -34,6 +35,7 @@
3435
z-index: $z-index-400;
3536
max-height: min(45vh, 600px);
3637
overflow-y: auto;
38+
border: var(--dropdown-border);
3739

3840
&.open {
3941
animation-name: slideUpIn;
@@ -64,6 +66,7 @@
6466
.dropdown-wrapper {
6567
&:focus-visible {
6668
box-shadow: var(--focus-visible-box-shadow);
69+
@include focus-visible-forced-colors();
6770
}
6871
}
6972
}

src/components/Inputs/input.module.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1750,6 +1750,7 @@
17501750
&:focus-visible {
17511751
border-color: var(--input-background-color);
17521752
box-shadow: var(--focus-visible-box-shadow);
1753+
@include focus-visible-forced-colors();
17531754

17541755
&.underline {
17551756
border-color: transparent;
@@ -1784,6 +1785,7 @@
17841785
&:focus-visible {
17851786
background: transparent;
17861787
box-shadow: var(--focus-visible-box-shadow);
1788+
@include focus-visible-forced-colors();
17871789

17881790
svg {
17891791
color: var(--grey-color);
@@ -1796,6 +1798,7 @@
17961798
&:focus-visible {
17971799
border-color: var(--input-background-color);
17981800
box-shadow: var(--focus-visible-box-shadow);
1801+
@include focus-visible-forced-colors();
17991802

18001803
&.underline {
18011804
border-color: transparent;

0 commit comments

Comments
 (0)