Skip to content

Commit 7829799

Browse files
committed
feat(MdSlider): add focus, active states
1 parent 9f26a74 commit 7829799

File tree

1 file changed

+38
-4
lines changed

1 file changed

+38
-4
lines changed

src/components/MdSlider/theme.scss

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
&:active::-ms-thumb {
2020
@include md-theme-property(background-color, primary);
2121
}
22-
&.is-lowest-value:active::-moz-range-thumb {
23-
@include md-theme-property(border-color, primary);
22+
&:focus:not(:active)::-webkit-slider-thumb {
23+
@include md-theme-property-value(box-shadow, 0 0 0 10px, primary, background, .26);
2424
}
25-
&.is-lowest-value:active::-webkit-slider-thumb {
26-
@include md-theme-property(border-color, primary);
25+
&:focus:not(:active)::-moz-range-thumb {
26+
@include md-theme-property-value(box-shadow, 0 0 0 10px, primary, background, .26);
2727
}
2828
@if md-get-theme-mode() == light {
2929
&.is-lowest-value::-webkit-slider-thumb {
@@ -33,6 +33,22 @@
3333
border-color: rgba(#000, .26);
3434
}
3535

36+
&.is-lowest-value:active::-moz-range-thumb {
37+
border-color: rgba(#000, .26);
38+
background-color: transparent;
39+
}
40+
&.is-lowest-value:active::-webkit-slider-thumb {
41+
border-color: rgba(#000, .26);
42+
background-color: transparent;
43+
}
44+
45+
&.is-lowest-value:focus:not(:active)::-webkit-slider-thumb {
46+
box-shadow: 0 0 0 10px rgba(#000, .12);
47+
}
48+
&.is-lowest-value:focus:not(:active)::-moz-range-thumb {
49+
box-shadow: 0 0 0 10px rgba(#000, .12);
50+
}
51+
3652
&.is-lowest-value:disabled:focus::-webkit-slider-thumb,
3753
&.is-lowest-value:disabled:active::-webkit-slider-thumb,
3854
&.is-lowest-value:disabled::-webkit-slider-thumb {
@@ -64,6 +80,24 @@
6480
border-color: rgba(#fff, .30);
6581
}
6682

83+
&.is-lowest-value:active::-moz-range-thumb {
84+
border-color: rgba(#fff, .30);
85+
background-color: transparent;
86+
}
87+
&.is-lowest-value:active::-webkit-slider-thumb {
88+
border-color: rgba(#fff, .30);
89+
background-color: transparent;
90+
}
91+
92+
&.is-lowest-value:focus:not(:active)::-webkit-slider-thumb {
93+
box-shadow: 0 0 0 10px rgba(#fff, .12);
94+
background-color: rgba(#fff, .12);
95+
}
96+
&.is-lowest-value:focus:not(:active)::-moz-range-thumb {
97+
box-shadow: 0 0 0 10px rgba(#fff, .12);
98+
background-color: rgba(#fff, .12);
99+
}
100+
67101
&.is-lowest-value:disabled:focus::-webkit-slider-thumb,
68102
&.is-lowest-value:disabled:active::-webkit-slider-thumb,
69103
&.is-lowest-value:disabled::-webkit-slider-thumb {

0 commit comments

Comments
 (0)