]>
Commit | Line | Data |
---|---|---|
63c4db6d C |
1 | @import '_variables'; |
2 | ||
26c6ee80 | 3 | @mixin disable-default-a-behaviour { |
cadb46d8 | 4 | &:hover, &:focus, &:active { |
26c6ee80 C |
5 | text-decoration: none !important; |
6 | outline: none !important; | |
7 | } | |
8 | } | |
c30745f3 | 9 | |
3ec8dc09 C |
10 | @mixin disable-outline { |
11 | outline: none; | |
12 | ||
13 | &::-moz-focus-inner { | |
14 | border: 0; | |
15 | padding: 0 | |
16 | } | |
17 | } | |
18 | ||
c30745f3 C |
19 | @mixin peertube-input-text($width) { |
20 | display: inline-block; | |
21 | height: $button-height; | |
22 | width: $width; | |
23 | background: #fff; | |
24 | border: 1px solid #C6C6C6; | |
25 | border-radius: 3px; | |
26 | padding-left: 15px; | |
15ca2e87 | 27 | padding-right: 15px; |
c30745f3 C |
28 | |
29 | &::placeholder { | |
30 | color: #585858; | |
31 | } | |
32 | } | |
33 | ||
5f0805d3 C |
34 | @mixin peertube-textarea ($width, $height) { |
35 | @include peertube-input-text($width); | |
36 | ||
37 | height: $height; | |
38 | padding: 5px 15px; | |
39 | font-size: 15px; | |
40 | } | |
41 | ||
7b272fd7 | 42 | @mixin orange-button { |
15a7387d C |
43 | &, &:active, &:focus { |
44 | color: #fff; | |
45 | background-color: $orange-color; | |
46 | } | |
7b272fd7 | 47 | |
15a7387d | 48 | &:hover { |
0727cab0 | 49 | color: #fff; |
7b272fd7 C |
50 | background-color: $orange-hoover-color; |
51 | } | |
4cc66133 C |
52 | |
53 | &[disabled], &.disabled { | |
54 | cursor: default; | |
cadb46d8 C |
55 | color: #fff; |
56 | background-color: #C6C6C6; | |
4cc66133 | 57 | } |
7b272fd7 C |
58 | } |
59 | ||
60 | @mixin grey-button { | |
15a7387d C |
61 | &, &:active, &:focus { |
62 | background-color: $grey-color; | |
63 | color: #585858; | |
64 | } | |
7b272fd7 | 65 | |
4cc66133 | 66 | &:hover, &:active, &:focus, &[disabled], &.disabled { |
0727cab0 | 67 | color: #585858; |
7b272fd7 C |
68 | background-color: $grey-hoover-color; |
69 | } | |
4cc66133 C |
70 | |
71 | &[disabled], &.disabled { | |
72 | cursor: default; | |
73 | } | |
7b272fd7 C |
74 | } |
75 | ||
c30745f3 C |
76 | @mixin peertube-button { |
77 | border: none; | |
c30745f3 C |
78 | font-weight: $font-semibold; |
79 | font-size: 15px; | |
80 | height: $button-height; | |
81 | line-height: $button-height; | |
82 | border-radius: 3px; | |
83 | text-align: center; | |
c30745f3 C |
84 | padding: 0 17px 0 13px; |
85 | cursor: pointer; | |
e600e1fe | 86 | outline: 0; |
c30745f3 C |
87 | } |
88 | ||
89 | @mixin peertube-button-link { | |
90 | display: inline-block; | |
91 | ||
c30745f3 | 92 | @include disable-default-a-behaviour; |
ce0e281d | 93 | @include peertube-button; |
c30745f3 | 94 | } |
2295ce6c | 95 | |
c5911fd3 C |
96 | @mixin peertube-button-file ($width) { |
97 | position: relative; | |
98 | overflow: hidden; | |
99 | display: inline-block; | |
100 | width: $width; | |
101 | ||
102 | @include peertube-button; | |
103 | @include orange-button; | |
104 | ||
105 | input[type=file] { | |
106 | position: absolute; | |
107 | top: 0; | |
108 | right: 0; | |
109 | min-width: 100%; | |
110 | min-height: 100%; | |
111 | font-size: 100px; | |
112 | text-align: right; | |
113 | filter: alpha(opacity=0); | |
114 | opacity: 0; | |
115 | outline: none; | |
116 | background: white; | |
117 | cursor: inherit; | |
118 | display: block; | |
119 | } | |
120 | } | |
121 | ||
0727cab0 C |
122 | @mixin icon ($size) { |
123 | display: inline-block; | |
124 | background-repeat: no-repeat; | |
125 | background-size: contain; | |
126 | width: $size; | |
127 | height: $size; | |
128 | vertical-align: middle; | |
129 | cursor: pointer; | |
130 | } | |
4cc66133 | 131 | |
15a7387d C |
132 | @mixin peertube-select-container ($width) { |
133 | padding: 0; | |
134 | margin: 0; | |
4cc66133 | 135 | border: 1px solid #C6C6C6; |
4cc66133 C |
136 | width: $width; |
137 | border-radius: 3px; | |
15a7387d C |
138 | overflow: hidden; |
139 | background: #fff; | |
140 | position: relative; | |
5f0805d3 | 141 | font-size: 15px; |
15a7387d C |
142 | |
143 | &:after { | |
144 | top: 50%; | |
145 | right: calc(0% + 15px); | |
146 | content: " "; | |
147 | height: 0; | |
148 | width: 0; | |
149 | position: absolute; | |
150 | pointer-events: none; | |
151 | border: 5px solid rgba(0, 0, 0, 0); | |
152 | border-top-color: #000000; | |
153 | margin-top: -2px; | |
154 | z-index: 100; | |
155 | } | |
156 | ||
157 | select { | |
108af661 | 158 | padding: 0 35px 0 12px; |
15a7387d C |
159 | width: calc(100% + 2px); |
160 | position: relative; | |
161 | left: 1px; | |
162 | border: none; | |
163 | box-shadow: none; | |
164 | background: transparent none; | |
165 | appearance: none; | |
166 | cursor: pointer; | |
167 | height: $button-height; | |
108af661 | 168 | text-overflow: ellipsis; |
15a7387d C |
169 | |
170 | &:focus { | |
171 | outline: none; | |
172 | } | |
173 | ||
174 | &:-moz-focusring { | |
175 | color: transparent; | |
176 | text-shadow: 0 0 0 #000; | |
177 | } | |
178 | } | |
179 | } | |
180 | ||
181 | @mixin peertube-select-disabled-container ($width) { | |
182 | @include peertube-select-container($width); | |
183 | ||
184 | background-color: #E5E5E5; | |
185 | ||
186 | select { | |
187 | cursor: default; | |
188 | } | |
4cc66133 | 189 | } |
a0d69908 | 190 | |
5f0805d3 C |
191 | // Thanks: https://codepen.io/triss90/pen/XNEdRe/ |
192 | @mixin peertube-radio-container { | |
193 | input[type="radio"] { | |
194 | display: none; | |
195 | ||
196 | & + label { | |
197 | font-weight: $font-regular; | |
198 | cursor: pointer; | |
199 | ||
200 | &:before { | |
201 | position: relative; | |
202 | top: -2px; | |
203 | content: ''; | |
204 | background: #fff; | |
205 | border-radius: 100%; | |
206 | border: 1px solid #000; | |
207 | display: inline-block; | |
208 | width: 15px; | |
209 | height: 15px; | |
210 | vertical-align: middle; | |
211 | cursor: pointer; | |
212 | text-align: center; | |
213 | margin-right: 10px; | |
214 | } | |
215 | } | |
216 | ||
217 | &:checked + label:before { | |
218 | background-color: #000; | |
219 | box-shadow: inset 0 0 0 4px #fff; | |
220 | } | |
221 | ||
222 | &:focus + label:before { | |
223 | outline: none; | |
224 | border-color: #000; | |
225 | } | |
226 | } | |
227 | } | |
228 | ||
a0d69908 C |
229 | @mixin peertube-checkbox ($border-width) { |
230 | display: none; | |
231 | ||
232 | & + label { | |
233 | position: relative; | |
234 | width: 18px; | |
235 | height: 18px; | |
236 | border: $border-width solid #000; | |
237 | border-radius: 3px; | |
238 | vertical-align: middle; | |
239 | cursor: pointer; | |
240 | ||
241 | &:after { | |
242 | content: ''; | |
243 | position: absolute; | |
244 | top: calc(2px - #{$border-width}); | |
245 | left: 5px; | |
246 | width: 5px; | |
247 | height: 12px; | |
248 | opacity: 0; | |
249 | transform: rotate(45deg) scale(0); | |
250 | border-right: 2px solid #fff; | |
251 | border-bottom: 2px solid #fff; | |
252 | } | |
253 | } | |
254 | ||
255 | &:checked + label { | |
256 | border-color: transparent; | |
257 | background: $orange-color; | |
258 | animation: jelly 0.6s ease; | |
259 | ||
260 | &:after { | |
261 | opacity: 1; | |
262 | transform: rotate(45deg) scale(1); | |
263 | } | |
264 | } | |
265 | ||
266 | & + label + label { | |
267 | font-size: 15px; | |
268 | font-weight: $font-regular; | |
269 | margin-left: 5px; | |
270 | cursor: pointer; | |
6693df9d | 271 | display: inline; |
a0d69908 C |
272 | } |
273 | } | |
274 | ||
4e8c8728 C |
275 | |
276 | @mixin avatar ($size) { | |
277 | object-fit: cover; | |
278 | border-radius:50%; | |
279 | width: $size; | |
280 | height: $size; | |
281 | } | |
c6352f2c C |
282 | |
283 | @mixin chevron ($size, $border-width) { | |
284 | border-style: solid; | |
285 | border-width: $border-width $border-width 0 0; | |
286 | content: ''; | |
287 | display: inline-block; | |
288 | transform: rotate(-45deg); | |
289 | height: $size; | |
290 | width: $size; | |
291 | } | |
292 | ||
293 | @mixin chevron-right ($size, $border-width) { | |
294 | @include chevron($size, $border-width); | |
295 | ||
296 | left: 0; | |
297 | transform: rotate(45deg); | |
298 | } | |
299 | ||
300 | @mixin chevron-left ($size, $border-width) { | |
301 | @include chevron($size, $border-width); | |
302 | ||
303 | left: 0.25em; | |
304 | transform: rotate(-135deg); | |
305 | } |