]>
Commit | Line | Data |
---|---|---|
1 | @import '_variables'; | |
2 | ||
3 | @mixin disable-default-a-behaviour { | |
4 | &:hover, &:focus, &:active { | |
5 | text-decoration: none !important; | |
6 | outline: none !important; | |
7 | } | |
8 | } | |
9 | ||
10 | @mixin disable-outline { | |
11 | &:focus:not(.focus-visible) { | |
12 | outline: none; | |
13 | } | |
14 | ||
15 | &::-moz-focus-inner { | |
16 | border: 0; | |
17 | padding: 0 | |
18 | } | |
19 | } | |
20 | ||
21 | ||
22 | @mixin ellipsis { | |
23 | white-space: nowrap; | |
24 | overflow: hidden; | |
25 | text-overflow: ellipsis; | |
26 | } | |
27 | ||
28 | @mixin ellipsis-multiline($font-size: 16px, $number-of-lines: 2) { | |
29 | display: block; | |
30 | /* Fallback for non-webkit */ | |
31 | display: -webkit-box; | |
32 | max-height: $font-size * $number-of-lines; | |
33 | /* Fallback for non-webkit */ | |
34 | font-size: $font-size; | |
35 | line-height: $font-size; | |
36 | overflow: hidden; | |
37 | text-overflow: ellipsis; | |
38 | } | |
39 | ||
40 | @mixin prefix($property, $parameters...) { | |
41 | @each $prefix in -webkit-, -moz-, -ms-, -o-, "" { | |
42 | #{$prefix}#{$property}: $parameters; | |
43 | } | |
44 | } | |
45 | ||
46 | @mixin peertube-word-wrap { | |
47 | word-break: break-word; | |
48 | word-wrap: break-word; | |
49 | overflow-wrap: break-word; | |
50 | -webkit-hyphens: auto; | |
51 | -ms-hyphens: auto; | |
52 | -moz-hyphens: auto; | |
53 | hyphens: auto; | |
54 | } | |
55 | ||
56 | @mixin apply-svg-color ($color) { | |
57 | ::ng-deep svg { | |
58 | path[fill="#000000"], | |
59 | g[fill="#000000"], | |
60 | rect[fill="#000000"], | |
61 | circle[fill="#000000"], | |
62 | polygon[fill="#000000"] { | |
63 | fill: $color; | |
64 | } | |
65 | ||
66 | path[stroke="#000000"], | |
67 | g[stroke="#000000"], | |
68 | rect[stroke="#000000"], | |
69 | circle[stroke="#000000"], | |
70 | polygon[stroke="#000000"] { | |
71 | stroke: $color; | |
72 | } | |
73 | ||
74 | stop[stop-color="#000000"] { | |
75 | stop-color: $color; | |
76 | } | |
77 | } | |
78 | } | |
79 | ||
80 | @mixin peertube-input-text($width) { | |
81 | display: inline-block; | |
82 | height: $button-height; | |
83 | width: $width; | |
84 | background: var(--inputColor); | |
85 | border: 1px solid #C6C6C6; | |
86 | border-radius: 3px; | |
87 | padding-left: 15px; | |
88 | padding-right: 15px; | |
89 | font-size: 15px; | |
90 | ||
91 | &::placeholder { | |
92 | color: var(--inputPlaceholderColor); | |
93 | } | |
94 | ||
95 | @media screen and (max-width: $width) { | |
96 | width: 100%; | |
97 | } | |
98 | } | |
99 | ||
100 | @mixin peertube-input-group($width) { | |
101 | width: $width; | |
102 | min-height: $button-height; | |
103 | padding-top: 0; | |
104 | padding-bottom: 0; | |
105 | ||
106 | .input-group-text{ | |
107 | font-size: 14px; | |
108 | color: gray; | |
109 | } | |
110 | } | |
111 | ||
112 | @mixin peertube-textarea ($width, $height) { | |
113 | @include peertube-input-text($width); | |
114 | ||
115 | height: $height; | |
116 | padding: 5px 15px; | |
117 | font-size: 15px; | |
118 | } | |
119 | ||
120 | @mixin orange-button { | |
121 | &, &:active, &:focus { | |
122 | color: #fff; | |
123 | background-color: var(--mainColor); | |
124 | } | |
125 | ||
126 | &:hover { | |
127 | color: #fff; | |
128 | background-color: var(--mainHoverColor); | |
129 | } | |
130 | ||
131 | &[disabled], &.disabled { | |
132 | cursor: default; | |
133 | color: #fff; | |
134 | background-color: #C6C6C6; | |
135 | } | |
136 | ||
137 | my-global-icon { | |
138 | @include apply-svg-color(#fff) | |
139 | } | |
140 | } | |
141 | ||
142 | @mixin grey-button { | |
143 | &, &:active, &:focus { | |
144 | background-color: $grey-background-color; | |
145 | color: $grey-foreground-color; | |
146 | } | |
147 | ||
148 | &:hover, &:active, &:focus, &[disabled], &.disabled { | |
149 | color: $grey-foreground-color; | |
150 | background-color: $grey-background-hover-color; | |
151 | } | |
152 | ||
153 | &[disabled], &.disabled { | |
154 | cursor: default; | |
155 | } | |
156 | ||
157 | my-global-icon { | |
158 | @include apply-svg-color($grey-foreground-color) | |
159 | } | |
160 | } | |
161 | ||
162 | @mixin peertube-button { | |
163 | border: none; | |
164 | font-weight: $font-semibold; | |
165 | font-size: 15px; | |
166 | height: $button-height; | |
167 | line-height: $button-height; | |
168 | border-radius: 3px; | |
169 | text-align: center; | |
170 | padding: 0 17px 0 13px; | |
171 | cursor: pointer; | |
172 | outline: 0; | |
173 | } | |
174 | ||
175 | @mixin peertube-button-link { | |
176 | display: inline-block; | |
177 | ||
178 | @include disable-default-a-behaviour; | |
179 | @include peertube-button; | |
180 | } | |
181 | ||
182 | @mixin button-with-icon($width: 20px, $margin-right: 3px, $top: -1px) { | |
183 | my-global-icon { | |
184 | position: relative; | |
185 | width: $width; | |
186 | margin-right: $margin-right; | |
187 | top: $top; | |
188 | } | |
189 | } | |
190 | ||
191 | @mixin peertube-button-file ($width) { | |
192 | position: relative; | |
193 | overflow: hidden; | |
194 | display: inline-block; | |
195 | width: $width; | |
196 | ||
197 | @include peertube-button; | |
198 | @include orange-button; | |
199 | ||
200 | input[type=file] { | |
201 | position: absolute; | |
202 | top: 0; | |
203 | right: 0; | |
204 | min-width: 100%; | |
205 | min-height: 100%; | |
206 | font-size: 100px; | |
207 | text-align: right; | |
208 | filter: alpha(opacity=0); | |
209 | opacity: 0; | |
210 | outline: none; | |
211 | background: white; | |
212 | cursor: inherit; | |
213 | display: block; | |
214 | } | |
215 | } | |
216 | ||
217 | @mixin icon ($size) { | |
218 | display: inline-block; | |
219 | background-repeat: no-repeat; | |
220 | background-size: contain; | |
221 | width: $size; | |
222 | height: $size; | |
223 | vertical-align: middle; | |
224 | cursor: pointer; | |
225 | } | |
226 | ||
227 | @mixin select-arrow-down { | |
228 | top: 50%; | |
229 | right: calc(0% + 15px); | |
230 | content: " "; | |
231 | height: 0; | |
232 | width: 0; | |
233 | position: absolute; | |
234 | pointer-events: none; | |
235 | border: 5px solid rgba(0, 0, 0, 0); | |
236 | border-top-color: #000; | |
237 | margin-top: -2px; | |
238 | z-index: 100; | |
239 | } | |
240 | ||
241 | @mixin peertube-select-container ($width) { | |
242 | padding: 0; | |
243 | margin: 0; | |
244 | border: 1px solid #C6C6C6; | |
245 | width: $width; | |
246 | border-radius: 3px; | |
247 | overflow: hidden; | |
248 | background: var(--inputColor); | |
249 | position: relative; | |
250 | font-size: 15px; | |
251 | ||
252 | &.disabled { | |
253 | background-color: #E5E5E5; | |
254 | ||
255 | select { | |
256 | cursor: default; | |
257 | } | |
258 | } | |
259 | ||
260 | @media screen and (max-width: $width) { | |
261 | width: 100%; | |
262 | } | |
263 | ||
264 | &:after { | |
265 | @include select-arrow-down; | |
266 | } | |
267 | ||
268 | select { | |
269 | padding: 0 35px 0 12px; | |
270 | width: calc(100% + 2px); | |
271 | position: relative; | |
272 | left: 1px; | |
273 | border: none; | |
274 | box-shadow: none; | |
275 | background: transparent none; | |
276 | appearance: none; | |
277 | cursor: pointer; | |
278 | height: $button-height; | |
279 | text-overflow: ellipsis; | |
280 | color: var(--mainForegroundColor); | |
281 | ||
282 | &:focus { | |
283 | outline: none; | |
284 | } | |
285 | ||
286 | &:-moz-focusring { | |
287 | color: transparent; | |
288 | text-shadow: 0 0 0 #000; | |
289 | } | |
290 | ||
291 | option { | |
292 | color: #000; | |
293 | } | |
294 | } | |
295 | } | |
296 | ||
297 | // Thanks: https://codepen.io/triss90/pen/XNEdRe/ | |
298 | @mixin peertube-radio-container { | |
299 | input[type="radio"] { | |
300 | display: none; | |
301 | ||
302 | & + label { | |
303 | font-weight: $font-regular; | |
304 | cursor: pointer; | |
305 | ||
306 | &:before { | |
307 | position: relative; | |
308 | top: -2px; | |
309 | content: ''; | |
310 | background: #fff; | |
311 | border-radius: 100%; | |
312 | border: 1px solid #000; | |
313 | display: inline-block; | |
314 | width: 15px; | |
315 | height: 15px; | |
316 | vertical-align: middle; | |
317 | cursor: pointer; | |
318 | text-align: center; | |
319 | margin-right: 10px; | |
320 | } | |
321 | } | |
322 | ||
323 | &:checked + label:before { | |
324 | background-color: #000; | |
325 | box-shadow: inset 0 0 0 4px #fff; | |
326 | } | |
327 | ||
328 | &:focus + label:before { | |
329 | outline: none; | |
330 | border-color: #000; | |
331 | } | |
332 | } | |
333 | } | |
334 | ||
335 | @mixin peertube-checkbox ($border-width) { | |
336 | opacity: 0; | |
337 | position: absolute; | |
338 | ||
339 | &:focus + span { | |
340 | box-shadow: 0 0 0 .1rem rgba(87, 85, 217, .2); | |
341 | } | |
342 | ||
343 | & + span { | |
344 | position: relative; | |
345 | width: 18px; | |
346 | min-width: 18px; | |
347 | height: 18px; | |
348 | border: $border-width solid $fg-color; | |
349 | border-radius: 3px; | |
350 | vertical-align: middle; | |
351 | cursor: pointer; | |
352 | ||
353 | &:after { | |
354 | content: ''; | |
355 | position: absolute; | |
356 | top: calc(2px - #{$border-width}); | |
357 | left: 5px; | |
358 | width: 5px; | |
359 | height: 12px; | |
360 | opacity: 0; | |
361 | transform: rotate(45deg) scale(0); | |
362 | border-right: 2px solid $bg-color; | |
363 | border-bottom: 2px solid $bg-color; | |
364 | } | |
365 | } | |
366 | ||
367 | &:checked + span { | |
368 | border-color: transparent; | |
369 | background: $orange-color; | |
370 | animation: jelly 0.6s ease; | |
371 | ||
372 | &:after { | |
373 | opacity: 1; | |
374 | transform: rotate(45deg) scale(1); | |
375 | } | |
376 | } | |
377 | ||
378 | & + span + span { | |
379 | font-size: 15px; | |
380 | font-weight: $font-regular; | |
381 | margin-left: 5px; | |
382 | cursor: pointer; | |
383 | display: inline; | |
384 | } | |
385 | ||
386 | &[disabled] + span, | |
387 | &[disabled] + span + span{ | |
388 | opacity: 0.5; | |
389 | cursor: default; | |
390 | } | |
391 | } | |
392 | ||
393 | ||
394 | @mixin avatar ($size) { | |
395 | object-fit: cover; | |
396 | border-radius: 50%; | |
397 | width: $size; | |
398 | height: $size; | |
399 | min-width: $size; | |
400 | min-height: $size; | |
401 | } | |
402 | ||
403 | @mixin chevron ($size, $border-width) { | |
404 | border-style: solid; | |
405 | border-width: $border-width $border-width 0 0; | |
406 | content: ''; | |
407 | display: inline-block; | |
408 | transform: rotate(-45deg); | |
409 | height: $size; | |
410 | width: $size; | |
411 | } | |
412 | ||
413 | @mixin chevron-right ($size, $border-width) { | |
414 | @include chevron($size, $border-width); | |
415 | ||
416 | left: 0; | |
417 | transform: rotate(45deg); | |
418 | } | |
419 | ||
420 | @mixin chevron-left ($size, $border-width) { | |
421 | @include chevron($size, $border-width); | |
422 | ||
423 | left: 0.25em; | |
424 | transform: rotate(-135deg); | |
425 | } | |
426 | ||
427 | @mixin in-content-small-title { | |
428 | text-transform: uppercase; | |
429 | color: var(--mainColor); | |
430 | font-weight: $font-bold; | |
431 | font-size: 13px; | |
432 | } | |
433 | ||
434 | @mixin actor-owner { | |
435 | @include disable-default-a-behaviour; | |
436 | ||
437 | display: inline-table; | |
438 | font-size: 13px; | |
439 | margin-top: 4px; | |
440 | color: var(--mainForegroundColor); | |
441 | ||
442 | span:hover { | |
443 | opacity: 0.8; | |
444 | } | |
445 | ||
446 | img { | |
447 | @include avatar(18px); | |
448 | ||
449 | margin-left: 7px; | |
450 | position: relative; | |
451 | top: -2px; | |
452 | } | |
453 | } | |
454 | ||
455 | @mixin sub-menu-with-actor { | |
456 | height: 160px; | |
457 | display: flex; | |
458 | flex-direction: column; | |
459 | align-items: flex-start; | |
460 | ||
461 | .actor { | |
462 | display: flex; | |
463 | margin-top: 20px; | |
464 | margin-bottom: 20px; | |
465 | ||
466 | img { | |
467 | @include avatar(80px); | |
468 | ||
469 | margin-right: 20px; | |
470 | } | |
471 | ||
472 | .actor-info { | |
473 | display: flex; | |
474 | flex-direction: column; | |
475 | justify-content: center; | |
476 | ||
477 | .actor-names { | |
478 | display: flex; | |
479 | align-items: center; | |
480 | ||
481 | .actor-display-name { | |
482 | font-size: 23px; | |
483 | font-weight: $font-bold; | |
484 | } | |
485 | ||
486 | .actor-name { | |
487 | margin-left: 7px; | |
488 | position: relative; | |
489 | top: 3px; | |
490 | font-size: 14px; | |
491 | color: $grey-actor-name; | |
492 | } | |
493 | } | |
494 | ||
495 | .actor-followers { | |
496 | font-size: 15px; | |
497 | } | |
498 | ||
499 | .actor-owner { | |
500 | @include actor-owner; | |
501 | } | |
502 | } | |
503 | } | |
504 | ||
505 | .links { | |
506 | margin-top: 0; | |
507 | margin-bottom: 10px; | |
508 | ||
509 | a { | |
510 | margin-top: 0; | |
511 | margin-bottom: 0; | |
512 | } | |
513 | } | |
514 | } | |
515 | ||
516 | @mixin create-button { | |
517 | @include peertube-button-link; | |
518 | @include orange-button; | |
519 | @include button-with-icon(20px, 5px, -1px); | |
520 | } | |
521 | ||
522 | @mixin row-blocks { | |
523 | display: flex; | |
524 | min-height: 130px; | |
525 | padding-bottom: 20px; | |
526 | margin-bottom: 20px; | |
527 | border-bottom: 1px solid #C6C6C6; | |
528 | ||
529 | @media screen and (max-width: 800px) { | |
530 | flex-direction: column; | |
531 | height: auto; | |
532 | align-items: center; | |
533 | } | |
534 | } | |
535 | ||
536 | @mixin dropdown-with-icon-item { | |
537 | padding: 6px 15px; | |
538 | ||
539 | my-global-icon { | |
540 | width: 22px; | |
541 | opacity: .7; | |
542 | ||
543 | margin-right: 10px; | |
544 | position: relative; | |
545 | top: -2px; | |
546 | } | |
547 | } |