Skip to content

Commit 4ffdef9

Browse files
committed
fix: fix some invalid color-styles
They were using rgba() in an incorrect way or used undefined variables. Closes #636 Also fixes wrong import-path in _datepicker.scss
1 parent b7fe8c9 commit 4ffdef9

File tree

7 files changed

+27
-24
lines changed

7 files changed

+27
-24
lines changed

components/datepicker/_datepicker.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@use './mixins.module.scss' as *;
1+
@use '../../sass/mixins.module.scss' as *;
22

33
.datepicker-container {
44
display: flex;
@@ -100,7 +100,7 @@
100100
display: block;
101101
font-size: 1.5rem;
102102
line-height: 25px;
103-
color: var(--md-sys-color-on-primary);
103+
color: var(--md-sys-color-on-primary);
104104
}
105105

106106
.date-text {
@@ -215,7 +215,7 @@
215215
z-index: 1;
216216

217217
&:hover {
218-
background-color: rgba(var(--md-sys-color-primary-numeric), 0.06);
218+
background-color: color-mix(in srgb, transparent, var(--md-sys-color-primary) 6%);
219219
}
220220

221221
&:focus {
@@ -262,7 +262,7 @@
262262

263263
/* Display modes */
264264
.datepicker-modal {
265-
max-width: calc(325px + var(--modal-padding)*2);
265+
max-width: calc(325px + var(--modal-padding) * 2);
266266
max-height: none;
267267
background-color: var(--md-sys-color-inverse-on-surface);
268268
}

components/radio-button/_radio-buttons.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878

7979
/* Focused styles */
8080
[type="radio"].tabbed:focus + span:before {
81-
box-shadow: 0 0 0 10px rgba(var(--md-sys-color-primary-numeric), 0.18);
81+
box-shadow: 0 0 0 10px color-mix(in srgb, transparent, var(--md-sys-color-primary) 18%);
8282
}
8383

8484
/* Disabled Radio With gap */

components/sliders/_range.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ input[type=range] + .thumb {
5353
border-radius: 50% 50% 50% 0;
5454

5555
.value {
56-
color: var(--md-sys-color-on-primary);
56+
color: var(--md-sys-color-on-primary);
5757
margin-left: -1px;
5858
margin-top: 8px;
5959
font-size: 10px;
@@ -97,7 +97,7 @@ input[type=range]::-webkit-slider-thumb {
9797
}
9898

9999
.keyboard-focused input[type=range]:focus:not(.active)::-webkit-slider-thumb {
100-
box-shadow: 0 0 0 10px rgba(var(--md-sys-color-primary-numeric), 0.18);
100+
box-shadow: 0 0 0 10px color-mix(in srgb, transparent, var(--md-sys-color-primary) 18%);
101101
}
102102

103103
// FireFox
@@ -125,7 +125,7 @@ input[type=range]:-moz-focusring {
125125
}
126126

127127
.keyboard-focused input[type=range]:focus:not(.active)::-moz-range-thumb {
128-
box-shadow: 0 0 0 10px rgba(var(--md-sys-color-primary-numeric), 0.18);
128+
box-shadow: 0 0 0 10px color-mix(in srgb, transparent, var(--md-sys-color-primary) 18%);
129129
}
130130

131131
//------------------------------- Remove this?
@@ -154,5 +154,5 @@ input[type=range]::-ms-thumb {
154154
//--------------------------------
155155

156156
.keyboard-focused input[type=range]:focus:not(.active)::-ms-thumb {
157-
box-shadow: 0 0 0 10px rgba(var(--md-sys-color-primary-numeric), 0.18);
157+
box-shadow: 0 0 0 10px color-mix(in srgb, transparent, var(--md-sys-color-primary) 18%);
158158
}

components/switch/_switches.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282

8383
// NOT CHECKED [DOT]
8484
&:after {
85-
@extend .outline;
85+
@extend .outline;
8686
height: var(--size-off);
8787
width: var(--size-off);
8888

@@ -98,13 +98,13 @@ input[type=checkbox]:not(:disabled) ~ .lever:hover::before {
9898
}
9999

100100
input[type=checkbox]:checked:not(:disabled) ~ .lever:hover::before {
101-
background-color: rgba(var(--md-sys-color-primary-numeric), 0.06);
101+
background-color: color-mix(in srgb, transparent, var(--md-sys-color-primary) 6%);
102102
}
103103

104104
// Switch active style
105105
input[type=checkbox]:checked:not(:disabled) ~ .lever:active::before,
106106
input[type=checkbox]:checked:not(:disabled).tabbed:focus ~ .lever::before {
107-
background-color: rgba(var(--md-sys-color-primary-numeric), 0.18);
107+
background-color: color-mix(in srgb, transparent, var(--md-sys-color-primary) 18%);
108108
}
109109

110110
input[type=checkbox]:not(:disabled) ~ .lever:hover::before {

components/tabs/_tabs.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@
3636
.tab a:hover,
3737
.tab a.active,
3838
.tab a:focus {
39-
color: var(--md-sys-color-on-primary);
39+
color: var(--md-sys-color-on-primary);
4040
}
4141

4242
.indicator {
43-
background-color: var(--md-sys-color-on-primary);
43+
background-color: var(--md-sys-color-on-primary);
4444
}
4545
}
4646

@@ -96,15 +96,15 @@
9696
}
9797

9898
&:hover {
99-
background-color: rgba(var(--md-sys-color-primary-numeric), 0.06);
99+
background-color: color-mix(in srgb, transparent, var(--md-sys-color-primary) 6%);
100100
}
101101

102102
&:focus {
103103
background-color: var(--md-sys-color-primary-container);
104104
}
105105

106106
&.active {
107-
background-color: rgba(var(--md-sys-color-primary-numeric), 0.18);
107+
background-color: color-mix(in srgb, transparent, var(--md-sys-color-primary) 18%);
108108
}
109109

110110
&:focus,

components/text-fields/_input-fields.scss

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ textarea.materialize-textarea {
6767
}
6868

6969
&:disabled, &[readonly="readonly"] {
70-
color: rgba(var(--md_sys_color_on-surface), 0.38);
71-
border-color: rgba(var(--md_sys_color_on-surface), 0.12);
72-
background-color: rgba(var(--md_sys_color_on-surface), 0.04);
70+
color: color-mix(in srgb, transparent, var(--md-sys-color-on-surface) 38%);
71+
border-color: color-mix(in srgb, transparent, var(--md-sys-color-on-surface) 12%);
72+
background-color: color-mix(in srgb, transparent, var(--md-sys-color-on-surface) 4%);
7373
}
7474

7575
// Label
@@ -86,7 +86,7 @@ textarea.materialize-textarea {
8686
}
8787

8888
&:disabled + label, &[readonly="readonly"] + label {
89-
color: rgba(var(--md_sys_color_on-surface), 0.38);
89+
color: color-mix(in srgb, transparent, var(--md-sys-color-on-surface) 38%);
9090
}
9191

9292
// Hide helper text on data message
@@ -208,8 +208,8 @@ textarea.materialize-textarea {
208208
}
209209

210210
&:disabled, &[readonly="readonly"] {
211-
color: rgba(var(--md_sys_color_on-surface), 0.38);
212-
border-color: rgba(var(--md_sys_color_on-surface), 0.12);
211+
color: color-mix(in srgb, transparent, var(--md-sys-color-on-surface) 38%);
212+
border-color: color-mix(in srgb, transparent, var(--md-sys-color-on-surface) 12%);
213213
}
214214
}
215215
}
@@ -323,7 +323,10 @@ textarea {
323323
/* Autocomplete Items */
324324
.autocomplete-content {
325325
li {
326-
.highlight { color: var(--md-sys-color-on-background); }
326+
.highlight {
327+
color: var(--md-sys-color-on-background);
328+
}
329+
327330
img {
328331
height: $dropdown-item-height - 10;
329332
width: $dropdown-item-height - 10;

components/timepicker/_timepicker.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ input[type=text].timepicker-input-minutes {
166166

167167
.timepicker-tick.active,
168168
.timepicker-tick:hover {
169-
background-color: rgba(var(--md-sys-color-primary-numeric), 0.06);
169+
background-color: color-mix(in srgb, transparent, var(--md-sys-color-primary) 6%);
170170
}
171171

172172
.timepicker-dial {

0 commit comments

Comments
 (0)