-
Notifications
You must be signed in to change notification settings - Fork 191
/
slider.css
155 lines (126 loc) · 3.45 KB
/
slider.css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
/*
Copyright 2020 Adobe. All rights reserved.
This file is licensed to you under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy
of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
OF ANY KIND, either express or implied. See the License for the specific language
governing permissions and limitations under the License.
*/
@import url('./spectrum-slider.css');
/*
* Removes blue outline from :host when it is being focused.
* This situation is not addressed in spectrum-css because the slider element itself
* is not intended to receive focus.
* This is not the case with web-components. The :host will receive focus when
* interacting with the slider via the mouse.
*/
:host(:focus) {
outline: 0;
}
:host([editable]) {
display: grid;
grid-template-columns: 1fr auto;
grid-template-areas:
'label number'
'slider number';
}
:host([editable]) #label-container {
grid-area: label;
}
:host([editable]) #label-container + div {
grid-area: slider;
}
:host([editable]) sp-number-field {
grid-area: number;
align-self: flex-end;
margin-inline-start: var(--spectrum-global-dimension-size-200);
}
:host([editable]) output {
border: 0;
clip: rect(0, 0, 0, 0);
clip-path: inset(50%);
height: 1px;
margin: 0 -1px -1px 0;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
white-space: nowrap;
}
:host([disabled]) {
pointer-events: none;
}
:host([dragging]),
#track {
touch-action: none;
user-select: none;
}
.not-exact.ticks {
justify-content: start;
}
:host([dir='ltr']) .not-exact .tick {
padding-right: var(--sp-slider-tick-offset);
}
:host([dir='rtl']) .not-exact .tick {
padding-left: var(--sp-slider-tick-offset);
}
:host([dir='ltr']) .not-exact .tick:after {
left: auto;
transform: translate(-50%, 0);
}
:host([dir='rtl']) .not-exact .tick:after {
right: auto;
transform: translate(50%, 0);
}
:host([dir='rtl']) .handle:before {
transform: translate(50%, -50%);
}
/*
* The following three declarationsa required while https://github.com/adobe/spectrum-css/issues/521
* waits to be addressed at the Spectrum CSS level.
*/
.track:before {
background-size: var(--spectrum-slider-track-background-size) !important;
}
:host([dir='ltr']) .track:last-of-type:before {
background-position: 100%;
}
:host([dir='rtl']) .track:first-of-type:before {
background-position: 100%;
}
:host([dir='ltr']) .track:not(:first-of-type, :last-of-type) {
left: var(--spectrum-slider-track-segment-position);
}
:host([dir='rtl']) .track:not(:first-of-type, :last-of-type) {
right: var(--spectrum-slider-track-segment-position);
}
.visually-hidden {
clip: rect(0 0 0 0);
clip-path: inset(50%);
height: 1px;
overflow: hidden;
position: absolute;
white-space: nowrap;
width: 1px;
}
:host([label-visibility='value'][dir='ltr']) #value {
margin-left: auto;
}
:host([label-visibility='value'][dir='rtl']) #value {
margin-right: auto;
}
:host([label-visibility='none']) #label-container {
padding: 0;
margin: 0;
}
:host([label-visibility='none']) #track {
align-self: flex-end;
}
.fill {
z-index: 2;
}
#slider-description {
display: none;
}