Skip to content

Commit d512910

Browse files
committed
Add fallback values to CSS variables
1 parent e8b7322 commit d512910

File tree

2 files changed

+25
-25
lines changed

2 files changed

+25
-25
lines changed

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
align-items: center;
66
width: 170px; /* default input width */
77
height: 32px;
8-
background: var(--Dash-Fill-Inverse-Strong);
9-
border-radius: var(--Dash-Spacing);
10-
border: 1px solid var(--Dash-Stroke-Strong);
8+
background: var(--Dash-Fill-Inverse-Strong, #fff);
9+
border-radius: var(--Dash-Spacing, 4px);
10+
border: 1px solid var(--Dash-Stroke-Strong, rgba(0, 18, 77, 0.45));
1111
box-sizing: border-box;
1212
container-type: inline-size;
1313
vertical-align: middle;
@@ -21,11 +21,11 @@
2121

2222
/* Input field styles */
2323
.dash-input-element {
24-
padding: var(--Dash-Spacing) calc(2 * var(--Dash-Spacing));
24+
padding: var(--Dash-Spacing, 4px) calc(2 * var(--Dash-Spacing, 4px));
2525
color: inherit;
2626
background: inherit;
2727
border: none;
28-
border-radius: var(--Dash-Spacing);
28+
border-radius: var(--Dash-Spacing, 4px);
2929
flex: 1 1 0;
3030
min-width: 0;
3131
height: 100%;
@@ -66,23 +66,23 @@
6666
width: 32px;
6767
height: 100%;
6868
border: none;
69-
background: var(--Dash-Fill-Inverse-Strong);
69+
background: var(--Dash-Fill-Inverse-Strong, #fff);
7070
cursor: pointer;
7171
font-size: 16px;
7272
font-weight: bold;
73-
color: var(--Dash-Text-Primary);
73+
color: var(--Dash-Text-Primary, rgba(0, 18, 77, 0.87));
7474
}
7575

7676
.dash-input-stepper:hover {
77-
background: var(--Dash-Fill-Primary-Hover);
77+
background: var(--Dash-Fill-Primary-Hover, rgba(0, 18, 77, 0.04));
7878
}
7979

8080
.dash-input-stepper:active {
81-
background: var(--Dash-Fill-Primary-Active);
81+
background: var(--Dash-Fill-Primary-Active, rgba(0, 18, 77, 0.08));
8282
}
8383

8484
.dash-input-stepper:disabled {
85-
background: var(--Dash-Fill-Inverse-Strong);
85+
background: var(--Dash-Fill-Inverse-Strong, #fff);
8686
opacity: 0.5;
8787
cursor: default;
8888
}

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

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
flex-grow: 1;
3333
border-radius: 9999px;
3434
height: 4px;
35-
background-color: var(--Dash-Fill-Disabled);
35+
background-color: var(--Dash-Fill-Disabled, rgba(0, 24, 102, 0.1));
3636
}
3737

3838
.dash-slider-root[data-orientation='vertical'] .dash-slider-track {
@@ -45,7 +45,7 @@
4545
position: absolute;
4646
border-radius: 9999px;
4747
height: 100%;
48-
background-color: var(--Dash-Fill-Interactive-Strong);
48+
background-color: var(--Dash-Fill-Interactive-Strong, #7f4bc4);
4949
}
5050

5151
.dash-slider-root[data-orientation='vertical'] .dash-slider-range {
@@ -57,8 +57,8 @@
5757
display: block;
5858
width: 16px;
5959
height: 16px;
60-
background-color: var(--Dash-Fill-Interactive-Strong);
61-
border: 2px solid var(--Dash-Fill-Inverse-Strong);
60+
background-color: var(--Dash-Fill-Interactive-Strong, #7f4bc4);
61+
border: 2px solid var(--Dash-Fill-Inverse-Strong, #fff);
6262
border-radius: 50%;
6363
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
6464
cursor: pointer;
@@ -86,7 +86,7 @@
8686
position: absolute;
8787
font-size: 12px;
8888
line-height: 12px;
89-
color: var(--Dash-Text-Strong);
89+
color: var(--Dash-Text-Strong, rgba(0, 9, 38, 0.9));
9090
white-space: nowrap;
9191
pointer-events: none;
9292
}
@@ -97,7 +97,7 @@
9797
bottom: 100%;
9898
left: 50%;
9999
transform: translateX(-50%);
100-
background-color: var(--Dash-Fill-Disabled);
100+
background-color: var(--Dash-Fill-Disabled, rgba(0, 24, 102, 0.1));
101101
width: 4px;
102102
height: 6px;
103103
border-radius: 2px;
@@ -117,21 +117,21 @@
117117
width: 8px;
118118
height: 8px;
119119
border-radius: 50%;
120-
background-color: var(--Dash-Fill-Disabled);
120+
background-color: var(--Dash-Fill-Disabled, rgba(0, 24, 102, 0.1));
121121
}
122122

123123
.dash-slider-tooltip {
124124
display: none;
125125
position: absolute;
126-
border-radius: var(--Dash-Spacing);
127-
padding: calc(var(--Dash-Spacing) * 3);
126+
border-radius: var(--Dash-Spacing, 4px);
127+
padding: calc(var(--Dash-Spacing, 4px) * 3);
128128
font-size: 12px;
129129
line-height: 1;
130130
box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
131-
background-color: var(--Dash-Fill-Inverse-Strong);
131+
background-color: var(--Dash-Fill-Inverse-Strong, #fff);
132132
user-select: none;
133133
z-index: 1000;
134-
fill: var(--Dash-Fill-Inverse-Strong);
134+
fill: var(--Dash-Fill-Inverse-Strong, #fff);
135135
}
136136

137137
.dash-slider-tooltip.always-visible {
@@ -140,7 +140,7 @@
140140

141141
/* Include property to mimic rc-slider behavior */
142142
.dash-slider-root:not([data-included='false']) .dash-slider-range {
143-
background-color: var(--Dash-Fill-Interactive-Strong);
143+
background-color: var(--Dash-Fill-Interactive-Strong, #7f4bc4);
144144
}
145145

146146
.dash-slider-root[data-included='false'] .dash-slider-range {
@@ -154,16 +154,16 @@
154154
}
155155

156156
.dash-slider-root[data-disabled] .dash-slider-track {
157-
background-color: var(--Dash-Fill-Disabled);
157+
background-color: var(--Dash-Fill-Disabled, rgba(0, 24, 102, 0.1));
158158
}
159159

160160
.dash-slider-root[data-disabled] .dash-slider-range {
161-
background-color: var(--Dash-Fill-Disabled);
161+
background-color: var(--Dash-Fill-Disabled, rgba(0, 24, 102, 0.1));
162162
}
163163

164164
.dash-slider-root[data-disabled] .dash-slider-thumb {
165165
cursor: not-allowed;
166-
border-color: var(--Dash-Fill-Disabled);
166+
border-color: var(--Dash-Fill-Disabled, rgba(0, 24, 102, 0.1));
167167
}
168168

169169
.dash-slider-container {

0 commit comments

Comments
 (0)