Skip to content

Commit bdc971e

Browse files
committed
Fix wcag color contrast on weak text; apply this to dropdown
1 parent 4b3e367 commit bdc971e

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

components/dash-core-components/src/components/css/dcc.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
--Dash-Text-Primary: rgba(0, 18, 77, 0.87);
99
--Dash-Text-Strong: rgba(0, 9, 38, 0.9);
1010
--Dash-Text-Weak: rgba(0, 12, 51, 0.65);
11-
--Dash-Text-Disabled: rgba(0, 21, 89, 0.3);
11+
--Dash-Text-Disabled: rgba(0, 21, 89, 0.6);
1212
--Dash-Fill-Primary-Hover: rgba(0, 18, 77, 0.04);
1313
--Dash-Fill-Primary-Active: rgba(0, 18, 77, 0.08);
1414
--Dash-Fill-Disabled: rgba(0, 24, 102, 0.1);

components/dash-core-components/src/components/css/dropdown.css

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,11 @@
104104

105105
.dash-dropdown-value-count {
106106
line-height: 18px;
107-
padding: 0 2px;
107+
padding: 4px;
108+
border-radius: 4px;
109+
color: var(--Dash-Text-Weak);
108110
background: var(--Dash-Fill-Weak);
111+
font-size: 0.875em;
109112
}
110113

111114
.dash-dropdown-search-container {
@@ -219,10 +222,13 @@
219222
box-shadow: 0 -1px 0 0 var(--Dash-Fill-Disabled) inset;
220223
}
221224

222-
.dash-dropdown-option input[type='radio'] {
225+
.dash-dropdown-option
226+
.dash-options-list-option-wrapper:has(input[type='radio']) {
227+
/* radio buttons are used in single-select dropdowns to aid keyboard
228+
* selection and screen readers, but visually, they are hidden
229+
*/
223230
width: 0;
224-
margin: 0;
225-
outline: none;
231+
overflow: hidden;
226232
}
227233

228234
/* Positioning container for the dropdown */

0 commit comments

Comments
 (0)