]>
Commit | Line | Data |
---|---|---|
1 | @use 'sass:math'; | |
2 | @use '_variables' as *; | |
3 | ||
4 | @mixin disable-default-a-behaviour { | |
5 | &:hover, | |
6 | &:focus, | |
7 | &:active { | |
8 | text-decoration: none !important; | |
9 | outline: none !important; | |
10 | } | |
11 | } | |
12 | ||
13 | @mixin disable-outline { | |
14 | &:focus:not(.focus-visible) { | |
15 | outline: none; | |
16 | } | |
17 | } | |
18 | ||
19 | @mixin ellipsis { | |
20 | white-space: nowrap; | |
21 | overflow: hidden; | |
22 | text-overflow: ellipsis; | |
23 | } | |
24 | ||
25 | @mixin ellipsis-multiline($font-size: 16px, $number-of-lines: 2) { | |
26 | display: block; | |
27 | /* Fallback for non-webkit */ | |
28 | display: -webkit-box; /* stylelint-disable-line value-no-vendor-prefix */ | |
29 | -webkit-line-clamp: $number-of-lines; | |
30 | /* Fallback for non-webkit */ | |
31 | font-size: $font-size; | |
32 | line-height: $font-size; | |
33 | overflow: hidden; | |
34 | text-overflow: ellipsis; | |
35 | max-height: $font-size * $number-of-lines; | |
36 | } | |
37 | ||
38 | @mixin fade-text ($fade-after, $background-color) { | |
39 | position: relative; | |
40 | overflow: hidden; | |
41 | ||
42 | &::after { | |
43 | content: ''; | |
44 | pointer-events: none; | |
45 | width: 100%; | |
46 | height: 100%; | |
47 | position: absolute; | |
48 | left: 0; | |
49 | top: 0; | |
50 | background: linear-gradient(transparent $fade-after, $background-color); | |
51 | } | |
52 | } | |
53 | ||
54 | @mixin peertube-word-wrap ($with-hyphen: true) { | |
55 | word-break: break-word; | |
56 | word-wrap: break-word; | |
57 | overflow-wrap: break-word; | |
58 | ||
59 | @if $with-hyphen { | |
60 | hyphens: auto; | |
61 | } | |
62 | } | |
63 | ||
64 | @mixin apply-svg-color ($color) { | |
65 | ::ng-deep .feather, | |
66 | ::ng-deep .material, | |
67 | ::ng-deep .misc { | |
68 | color: $color; | |
69 | } | |
70 | } | |
71 | ||
72 | @mixin fill-svg-color ($color) { | |
73 | ::ng-deep svg { | |
74 | path { | |
75 | fill: $color; | |
76 | } | |
77 | } | |
78 | } | |
79 | ||
80 | @mixin button-focus($color) { | |
81 | &:focus, | |
82 | &.focus-visible { | |
83 | box-shadow: #{$focus-box-shadow-form} $color; | |
84 | } | |
85 | } | |
86 | ||
87 | @mixin peertube-input-text($width) { | |
88 | padding: 0 15px; | |
89 | display: inline-block; | |
90 | height: $button-height; | |
91 | width: $width; | |
92 | color: pvar(--inputForegroundColor); | |
93 | background-color: pvar(--inputBackgroundColor); | |
94 | border: 1px solid #C6C6C6; | |
95 | border-radius: 3px; | |
96 | font-size: 15px; | |
97 | ||
98 | &::placeholder { | |
99 | color: pvar(--inputPlaceholderColor); | |
100 | } | |
101 | ||
102 | &[readonly] { | |
103 | opacity: 0.7; | |
104 | } | |
105 | ||
106 | @media screen and (max-width: calc(#{$width} + 40px)) { | |
107 | width: 100%; | |
108 | } | |
109 | } | |
110 | ||
111 | @mixin peertube-input-group($width) { | |
112 | width: $width; | |
113 | min-height: $button-height; | |
114 | padding-top: 0; | |
115 | padding-bottom: 0; | |
116 | flex-wrap: nowrap; | |
117 | ||
118 | .input-group-text { | |
119 | font-size: 14px; | |
120 | color: #808080; | |
121 | } | |
122 | } | |
123 | ||
124 | @mixin peertube-textarea ($width, $height) { | |
125 | @include peertube-input-text($width); | |
126 | ||
127 | color: pvar(--textareaForegroundColor); | |
128 | background-color: pvar(--textareaBackgroundColor); | |
129 | height: $height; | |
130 | padding: 5px 15px; | |
131 | font-size: 15px; | |
132 | } | |
133 | ||
134 | @mixin orange-button { | |
135 | @include button-focus(pvar(--mainColorLightest)); | |
136 | ||
137 | &, | |
138 | &:active, | |
139 | &:focus { | |
140 | color: #fff; | |
141 | background-color: pvar(--mainColor); | |
142 | } | |
143 | ||
144 | &:hover { | |
145 | color: #fff; | |
146 | background-color: pvar(--mainHoverColor); | |
147 | } | |
148 | ||
149 | &[disabled], | |
150 | &.disabled { | |
151 | cursor: default; | |
152 | color: #fff; | |
153 | background-color: #C6C6C6; | |
154 | } | |
155 | ||
156 | my-global-icon { | |
157 | @include apply-svg-color(#fff); | |
158 | } | |
159 | } | |
160 | ||
161 | @mixin orange-button-inverted { | |
162 | @include button-focus(pvar(--mainColorLightest)); | |
163 | ||
164 | border: 2px solid pvar(--mainColor); | |
165 | font-weight: $font-semibold; | |
166 | ||
167 | &, | |
168 | &:active, | |
169 | &:focus { | |
170 | color: pvar(--mainColor); | |
171 | background-color: pvar(--mainBackgroundColor); | |
172 | } | |
173 | ||
174 | &:hover { | |
175 | color: pvar(--mainColor); | |
176 | background-color: pvar(--mainColorLightest); | |
177 | } | |
178 | ||
179 | &[disabled], | |
180 | &.disabled { | |
181 | cursor: default; | |
182 | color: pvar(--mainColor); | |
183 | background-color: #C6C6C6; | |
184 | } | |
185 | ||
186 | my-global-icon { | |
187 | @include apply-svg-color(pvar(--mainColor)); | |
188 | } | |
189 | } | |
190 | ||
191 | @mixin tertiary-button { | |
192 | @include button-focus($grey-button-outline-color); | |
193 | ||
194 | color: pvar(--greyForegroundColor); | |
195 | background-color: transparent; | |
196 | ||
197 | &[disabled], | |
198 | .disabled { | |
199 | cursor: default; | |
200 | } | |
201 | ||
202 | my-global-icon { | |
203 | @include apply-svg-color(transparent); | |
204 | } | |
205 | } | |
206 | ||
207 | @mixin grey-button { | |
208 | @include button-focus($grey-button-outline-color); | |
209 | ||
210 | background-color: $grey-background-color; | |
211 | color: pvar(--greyForegroundColor); | |
212 | ||
213 | &:hover, | |
214 | &:active, | |
215 | &:focus, | |
216 | &[disabled], | |
217 | &.disabled { | |
218 | color: pvar(--greyForegroundColor); | |
219 | background-color: $grey-background-hover-color; | |
220 | } | |
221 | ||
222 | &[disabled], | |
223 | &.disabled { | |
224 | cursor: default; | |
225 | } | |
226 | ||
227 | my-global-icon { | |
228 | @include apply-svg-color(pvar(--greyForegroundColor)); | |
229 | } | |
230 | } | |
231 | ||
232 | @mixin danger-button { | |
233 | $color: lighten($color: #c54130, $amount: 10); | |
234 | $text: #fff6f5; | |
235 | ||
236 | @include button-focus(scale-color($color, $alpha: -95%)); | |
237 | ||
238 | background-color: $color; | |
239 | color: $text; | |
240 | ||
241 | &:hover, | |
242 | &:active, | |
243 | &:focus, | |
244 | &[disabled], | |
245 | &.disabled { | |
246 | background-color: lighten($color: $color, $amount: 10); | |
247 | } | |
248 | ||
249 | &[disabled], | |
250 | &.disabled { | |
251 | cursor: default; | |
252 | } | |
253 | ||
254 | my-global-icon { | |
255 | @include apply-svg-color($text); | |
256 | } | |
257 | } | |
258 | ||
259 | @mixin peertube-button { | |
260 | @include padding(0, 17px, 0, 13px); | |
261 | ||
262 | border: 0; | |
263 | font-weight: $font-semibold; | |
264 | font-size: 15px; | |
265 | height: $button-height; | |
266 | line-height: $button-height; | |
267 | // FIXME: because of primeng that redefines border-radius of all input[type="..."] | |
268 | border-radius: 3px !important; | |
269 | text-align: center; | |
270 | cursor: pointer; | |
271 | } | |
272 | ||
273 | @mixin peertube-button-link { | |
274 | @include disable-default-a-behaviour; | |
275 | @include peertube-button; | |
276 | ||
277 | display: inline-block; | |
278 | } | |
279 | ||
280 | @mixin peertube-button-outline { | |
281 | @include disable-default-a-behaviour; | |
282 | @include peertube-button; | |
283 | ||
284 | display: inline-block; | |
285 | border: 1px solid; | |
286 | } | |
287 | ||
288 | @mixin button-with-icon($width: 20px, $margin-right: 3px, $top: -1px) { | |
289 | display: inline-flex; | |
290 | align-items: center; | |
291 | line-height: normal !important; | |
292 | ||
293 | my-global-icon { | |
294 | @include margin-right($margin-right); | |
295 | ||
296 | position: relative; | |
297 | width: $width; | |
298 | top: $top; | |
299 | } | |
300 | } | |
301 | ||
302 | @mixin peertube-file { | |
303 | position: relative; | |
304 | overflow: hidden; | |
305 | display: inline-block; | |
306 | min-height: 30px; | |
307 | ||
308 | input[type=file] { | |
309 | position: absolute; | |
310 | top: 0; | |
311 | right: 0; | |
312 | width: 100%; | |
313 | height: 100%; | |
314 | font-size: 100px; | |
315 | text-align: end; | |
316 | filter: alpha(opacity=0); | |
317 | opacity: 0; | |
318 | outline: none; | |
319 | background: #fff; | |
320 | cursor: inherit; | |
321 | display: block; | |
322 | } | |
323 | } | |
324 | ||
325 | @mixin peertube-button-file ($width) { | |
326 | @include peertube-file; | |
327 | @include peertube-button; | |
328 | ||
329 | width: $width; | |
330 | } | |
331 | ||
332 | @mixin icon ($size) { | |
333 | display: inline-block; | |
334 | background-repeat: no-repeat; | |
335 | background-size: contain; | |
336 | width: $size; | |
337 | height: $size; | |
338 | vertical-align: middle; | |
339 | cursor: pointer; | |
340 | } | |
341 | ||
342 | @mixin responsive-width ($width) { | |
343 | width: $width; | |
344 | ||
345 | @media screen and (max-width: $width) { | |
346 | width: 100%; | |
347 | } | |
348 | } | |
349 | ||
350 | @mixin peertube-select-container ($width) { | |
351 | padding: 0; | |
352 | margin: 0; | |
353 | width: $width; | |
354 | border-radius: 3px; | |
355 | color: pvar(--inputForegroundColor); | |
356 | background: pvar(--inputBackgroundColor); | |
357 | position: relative; | |
358 | font-size: 15px; | |
359 | ||
360 | &.disabled { | |
361 | background-color: #E5E5E5; | |
362 | ||
363 | select { | |
364 | cursor: default; | |
365 | } | |
366 | } | |
367 | ||
368 | @media screen and (max-width: $width) { | |
369 | width: 100%; | |
370 | } | |
371 | ||
372 | &::after { | |
373 | top: 50%; | |
374 | right: calc(0% + 15px); | |
375 | content: ' '; | |
376 | height: 0; | |
377 | width: 0; | |
378 | position: absolute; | |
379 | pointer-events: none; | |
380 | border: 5px solid rgba(0, 0, 0, 0); | |
381 | border-top-color: #000; | |
382 | margin-top: -2px; | |
383 | z-index: 100; | |
384 | } | |
385 | ||
386 | select { | |
387 | padding: 0 35px 0 12px; | |
388 | position: relative; | |
389 | border: 1px solid #C6C6C6; | |
390 | background: transparent none; | |
391 | appearance: none; | |
392 | cursor: pointer; | |
393 | height: $button-height; | |
394 | text-overflow: ellipsis; | |
395 | color: pvar(--mainForegroundColor); | |
396 | ||
397 | &:focus { | |
398 | outline: none; | |
399 | } | |
400 | ||
401 | &:-moz-focusring { | |
402 | color: transparent; | |
403 | text-shadow: 0 0 0 #000; | |
404 | } | |
405 | ||
406 | option { | |
407 | color: #000; | |
408 | } | |
409 | } | |
410 | ||
411 | &.peertube-select-button { | |
412 | @include grey-button; | |
413 | ||
414 | select, | |
415 | option { | |
416 | font-weight: $font-semibold; | |
417 | color: pvar(--greyForegroundColor); | |
418 | border: 0; | |
419 | } | |
420 | } | |
421 | } | |
422 | ||
423 | // Thanks: https://codepen.io/triss90/pen/XNEdRe/ | |
424 | @mixin peertube-radio-container { | |
425 | input[type=radio] { | |
426 | display: none; | |
427 | ||
428 | + label { | |
429 | font-weight: $font-regular; | |
430 | cursor: pointer; | |
431 | ||
432 | &::before { | |
433 | @include margin-right(10px); | |
434 | ||
435 | position: relative; | |
436 | top: -2px; | |
437 | content: ''; | |
438 | background: #fff; | |
439 | border-radius: 100%; | |
440 | border: 1px solid #000; | |
441 | display: inline-block; | |
442 | width: 15px; | |
443 | height: 15px; | |
444 | vertical-align: middle; | |
445 | cursor: pointer; | |
446 | text-align: center; | |
447 | } | |
448 | } | |
449 | ||
450 | &:checked + label::before { | |
451 | background-color: #000; | |
452 | box-shadow: inset 0 0 0 4px #fff; | |
453 | } | |
454 | ||
455 | &:focus + label::before { | |
456 | outline: none; | |
457 | border-color: #000; | |
458 | } | |
459 | } | |
460 | } | |
461 | ||
462 | @mixin peertube-checkbox ($border-width) { | |
463 | opacity: 0; | |
464 | position: absolute; | |
465 | ||
466 | &:focus + span { | |
467 | box-shadow: #{$focus-box-shadow-form} pvar(--mainColorLightest); | |
468 | } | |
469 | ||
470 | + span { | |
471 | position: relative; | |
472 | width: 18px; | |
473 | min-width: 18px; | |
474 | height: 18px; | |
475 | border: $border-width solid #C6C6C6; | |
476 | border-radius: 3px; | |
477 | vertical-align: middle; | |
478 | cursor: pointer; | |
479 | ||
480 | &::after { | |
481 | content: ''; | |
482 | position: absolute; | |
483 | top: calc(2px - #{$border-width}); | |
484 | left: 5px; | |
485 | width: 5px; | |
486 | height: 12px; | |
487 | opacity: 0; | |
488 | transform: rotate(45deg) scale(0); | |
489 | border-right: 2px solid $bg-color; | |
490 | border-bottom: 2px solid $bg-color; | |
491 | } | |
492 | } | |
493 | ||
494 | &:checked + span { | |
495 | border-color: transparent; | |
496 | background: pvar(--mainColor); | |
497 | animation: jelly 0.6s ease; | |
498 | ||
499 | &::after { | |
500 | opacity: 1; | |
501 | transform: rotate(45deg) scale(1); | |
502 | } | |
503 | } | |
504 | ||
505 | + span + span { | |
506 | @include margin-left(5px); | |
507 | ||
508 | font-size: 15px; | |
509 | font-weight: $font-regular; | |
510 | cursor: pointer; | |
511 | display: inline; | |
512 | } | |
513 | ||
514 | &[disabled] + span, | |
515 | &[disabled] + span + span { | |
516 | opacity: 0.5; | |
517 | cursor: default; | |
518 | } | |
519 | } | |
520 | ||
521 | @mixin table-badge { | |
522 | border-radius: 2px; | |
523 | padding: 1/4em 1/2em; | |
524 | text-transform: uppercase; | |
525 | font-weight: $font-bold; | |
526 | font-size: 12px; | |
527 | letter-spacing: 1/3px; | |
528 | ||
529 | &.badge-banned, | |
530 | &.badge-red { | |
531 | background-color: #ffcdd2; | |
532 | color: #c63737; | |
533 | } | |
534 | ||
535 | &.badge-banned { | |
536 | text-decoration: line-through; | |
537 | } | |
538 | ||
539 | &.badge-yellow { | |
540 | background-color: #feedaf; | |
541 | color: #8a5340; | |
542 | } | |
543 | ||
544 | &.badge-brown { | |
545 | background-color: #ffd8b2; | |
546 | color: #805b36; | |
547 | } | |
548 | ||
549 | &.badge-green { | |
550 | background-color: #c8e6c9; | |
551 | color: #256029; | |
552 | } | |
553 | ||
554 | &.badge-blue { | |
555 | background-color: #b3e5fc; | |
556 | color: #23547b; | |
557 | } | |
558 | ||
559 | &.badge-purple { | |
560 | background-color: #eccfff; | |
561 | color: #694382; | |
562 | } | |
563 | } | |
564 | ||
565 | @mixin actor-avatar-size ($size) { | |
566 | display: inline-block; | |
567 | width: $size; | |
568 | height: $size; | |
569 | min-width: $size; | |
570 | min-height: $size; | |
571 | } | |
572 | ||
573 | @mixin actor-counters ($separator-margin: 10px) { | |
574 | color: pvar(--greyForegroundColor); | |
575 | font-size: 16px; | |
576 | display: flex; | |
577 | align-items: center; | |
578 | ||
579 | > *:not(:last-child)::after { | |
580 | content: '•'; | |
581 | margin: 0 $separator-margin; | |
582 | color: pvar(--mainColor); | |
583 | } | |
584 | } | |
585 | ||
586 | @mixin chevron ($size, $border-width) { | |
587 | border-style: solid; | |
588 | border-width: $border-width $border-width 0 0; | |
589 | content: ''; | |
590 | display: inline-block; | |
591 | transform: rotate(-45deg); | |
592 | height: $size; | |
593 | width: $size; | |
594 | } | |
595 | ||
596 | @mixin chevron-right ($size, $border-width) { | |
597 | @include chevron($size, $border-width); | |
598 | ||
599 | left: 0; | |
600 | transform: rotate(45deg); | |
601 | } | |
602 | ||
603 | @mixin chevron-left ($size, $border-width) { | |
604 | @include chevron($size, $border-width); | |
605 | ||
606 | left: 0.25em; | |
607 | transform: rotate(-135deg); | |
608 | } | |
609 | ||
610 | @mixin in-content-small-title { | |
611 | text-transform: uppercase; | |
612 | color: pvar(--mainColor); | |
613 | font-weight: $font-bold; | |
614 | font-size: 13px; | |
615 | } | |
616 | ||
617 | @mixin settings-big-title { | |
618 | text-transform: uppercase; | |
619 | color: pvar(--mainColor); | |
620 | font-weight: $font-bold; | |
621 | font-size: 110%; | |
622 | margin-bottom: 10px; | |
623 | } | |
624 | ||
625 | @mixin create-button { | |
626 | @include peertube-button-link; | |
627 | @include orange-button; | |
628 | @include button-with-icon(20px, 5px, -1px); | |
629 | } | |
630 | ||
631 | @mixin row-blocks ($column-responsive: true) { | |
632 | display: flex; | |
633 | min-height: 130px; | |
634 | padding-bottom: 20px; | |
635 | margin-bottom: 20px; | |
636 | border-bottom: 1px solid #C6C6C6; | |
637 | ||
638 | @media screen and (max-width: $small-view) { | |
639 | @if $column-responsive { | |
640 | flex-direction: column; | |
641 | height: auto; | |
642 | align-items: center; | |
643 | } @else { | |
644 | min-height: initial; | |
645 | padding-bottom: 10px; | |
646 | margin-bottom: 10px; | |
647 | } | |
648 | } | |
649 | } | |
650 | ||
651 | @mixin dropdown-with-icon-item { | |
652 | padding: 6px 15px; | |
653 | ||
654 | my-global-icon { | |
655 | @include margin-right(10px); | |
656 | ||
657 | width: 22px; | |
658 | opacity: .7; | |
659 | position: relative; | |
660 | top: -2px; | |
661 | } | |
662 | } | |
663 | ||
664 | @mixin progressbar($small: false) { | |
665 | background-color: $grey-background-color; | |
666 | display: flex; | |
667 | height: 1rem; | |
668 | overflow: hidden; | |
669 | font-size: 0.75rem; | |
670 | border-radius: 0.25rem; | |
671 | position: relative; | |
672 | ||
673 | span { | |
674 | position: absolute; | |
675 | color: $grey-foreground-color; | |
676 | @if $small { | |
677 | top: -1px; | |
678 | } | |
679 | ||
680 | &:nth-of-type(1) { | |
681 | left: .2rem; | |
682 | } | |
683 | &:nth-of-type(2) { | |
684 | right: .2rem; | |
685 | } | |
686 | } | |
687 | ||
688 | .progress-bar { | |
689 | color: pvar(--mainBackgroundColor); | |
690 | background-color: pvar(--mainColor); | |
691 | display: flex; | |
692 | flex-direction: column; | |
693 | justify-content: center; | |
694 | text-align: center; | |
695 | white-space: nowrap; | |
696 | transition: width 0.6s ease; | |
697 | ||
698 | &.secondary { | |
699 | background-color: pvar(--secondaryColor); | |
700 | } | |
701 | ||
702 | &.red { | |
703 | background-color: lighten($color: #c54130, $amount: 10); | |
704 | } | |
705 | } | |
706 | } | |
707 | ||
708 | @mixin breadcrumb { | |
709 | display: flex; | |
710 | flex-wrap: wrap; | |
711 | padding: 0.75rem 1rem; | |
712 | margin-bottom: 1rem; | |
713 | list-style: none; | |
714 | background-color: pvar(--submenuBackgroundColor); | |
715 | border-radius: 0.25rem; | |
716 | ||
717 | .breadcrumb-item { | |
718 | display: flex; | |
719 | ||
720 | a { | |
721 | color: pvar(--mainColor); | |
722 | } | |
723 | ||
724 | + .breadcrumb-item { | |
725 | @include padding-left(0.5rem); | |
726 | ||
727 | &::before { | |
728 | @include padding-right(0.5rem); | |
729 | ||
730 | display: inline-block; | |
731 | color: #6c757d; | |
732 | content: '/'; | |
733 | } | |
734 | } | |
735 | ||
736 | &.active { | |
737 | color: #6c757d; | |
738 | } | |
739 | } | |
740 | } | |
741 | ||
742 | @mixin dashboard { | |
743 | display: flex; | |
744 | flex-wrap: wrap; | |
745 | margin: 0 -5px; | |
746 | ||
747 | > div { | |
748 | box-sizing: border-box; | |
749 | flex: 0 0 percentage(math.div(1, 3)); | |
750 | padding: 0 5px; | |
751 | margin-bottom: 10px; | |
752 | ||
753 | > a { | |
754 | @include disable-default-a-behaviour; | |
755 | ||
756 | text-decoration: none; | |
757 | color: inherit; | |
758 | display: block; | |
759 | font-size: 18px; | |
760 | ||
761 | &:active, | |
762 | &:focus, | |
763 | &:hover { | |
764 | opacity: .8; | |
765 | } | |
766 | } | |
767 | ||
768 | > a, | |
769 | > div { | |
770 | padding: 20px; | |
771 | background: pvar(--submenuBackgroundColor); | |
772 | border-radius: 4px; | |
773 | box-sizing: border-box; | |
774 | height: 100%; | |
775 | } | |
776 | } | |
777 | ||
778 | .dashboard-num, | |
779 | .dashboard-text { | |
780 | text-align: center; | |
781 | font-size: 130%; | |
782 | color: pvar(--mainForegroundColor); | |
783 | line-height: 30px; | |
784 | margin-bottom: 20px; | |
785 | } | |
786 | ||
787 | .dashboard-label { | |
788 | font-size: 90%; | |
789 | color: pvar(--inputPlaceholderColor); | |
790 | text-align: center; | |
791 | } | |
792 | } | |
793 | ||
794 | @mixin divider($color: pvar(--submenuBackgroundColor), $background: pvar(--mainBackgroundColor)) { | |
795 | width: 95%; | |
796 | border-top: .05rem solid $color; | |
797 | height: .05rem; | |
798 | text-align: center; | |
799 | display: block; | |
800 | position: relative; | |
801 | ||
802 | &[data-content] { | |
803 | margin: .8rem 0; | |
804 | ||
805 | &::after { | |
806 | background: $background; | |
807 | color: $color; | |
808 | content: attr(data-content); | |
809 | display: inline-block; | |
810 | font-size: .7rem; | |
811 | padding: 0 .4rem; | |
812 | transform: translateY(-.65rem); | |
813 | } | |
814 | } | |
815 | } | |
816 | ||
817 | @mixin chip { | |
818 | --chip-radius: 5rem; | |
819 | --chip-padding: .2rem .4rem; | |
820 | $avatar-height: 1.2rem; | |
821 | ||
822 | align-items: center; | |
823 | border-radius: var(--chip-radius); | |
824 | display: inline-flex; | |
825 | font-size: 90%; | |
826 | color: pvar(--mainForegroundColor); | |
827 | height: $avatar-height; | |
828 | line-height: 1rem; | |
829 | margin: .1rem; | |
830 | max-width: 320px; | |
831 | overflow: hidden; | |
832 | padding: var(--chip-padding); | |
833 | text-decoration: none; | |
834 | text-overflow: ellipsis; | |
835 | vertical-align: middle; | |
836 | white-space: nowrap; | |
837 | ||
838 | &.rectangular { | |
839 | --chip-radius: .2rem; | |
840 | --chip-padding: .2rem .3rem; | |
841 | } | |
842 | ||
843 | my-actor-avatar { | |
844 | @include margin-left(-.4rem); | |
845 | @include margin-right(.2rem); | |
846 | } | |
847 | ||
848 | &.two-lines { | |
849 | $avatar-height: 2rem; | |
850 | ||
851 | height: $avatar-height; | |
852 | ||
853 | my-actor-avatar { | |
854 | @include actor-avatar-size($avatar-height); | |
855 | } | |
856 | ||
857 | div { | |
858 | margin: 0 .1rem; | |
859 | ||
860 | display: flex; | |
861 | flex-direction: column; | |
862 | height: $avatar-height; | |
863 | justify-content: center; | |
864 | } | |
865 | } | |
866 | } | |
867 | ||
868 | // applies ratio (default to 16:9) to a child element (using $selector) only using | |
869 | // an immediate's parent size. This allows to set a ratio without explicit | |
870 | // dimensions, as width/height cannot be computed from each other. | |
871 | @mixin block-ratio ($selector: 'div', $inverted-ratio: math.div(9, 16)) { | |
872 | $padding-percent: percentage($inverted-ratio); | |
873 | ||
874 | position: relative; | |
875 | height: 0; | |
876 | width: 100%; | |
877 | padding-top: $padding-percent; | |
878 | ||
879 | #{$selector} { | |
880 | position: absolute; | |
881 | width: 100%; | |
882 | height: 100%; | |
883 | top: 0; | |
884 | ||
885 | @content; | |
886 | } | |
887 | } | |
888 | ||
889 | @mixin sub-menu-h1 { | |
890 | ::ng-deep h1 { | |
891 | font-size: 1.3rem; | |
892 | border-bottom: 2px solid $grey-background-color; | |
893 | padding-bottom: 15px; | |
894 | margin-bottom: $sub-menu-margin-bottom; | |
895 | ||
896 | > span > my-global-icon, | |
897 | > my-global-icon { | |
898 | @include margin-right(10px); | |
899 | width: 24px; | |
900 | height: 24px; | |
901 | vertical-align: top; | |
902 | } | |
903 | ||
904 | .badge { | |
905 | @include margin-left(7px); | |
906 | vertical-align: top; | |
907 | } | |
908 | } | |
909 | } | |
910 | ||
911 | @mixin play-icon ($width, $height) { | |
912 | width: 0; | |
913 | height: 0; | |
914 | ||
915 | position: absolute; | |
916 | left: 50%; | |
917 | top: 50%; | |
918 | transform: translate(-50%, -50%) scale(0.5); | |
919 | ||
920 | border-top: #{math.div($height, 2)} solid transparent; | |
921 | border-bottom: #{math.div($height, 2)} solid transparent; | |
922 | ||
923 | border-left: $width solid rgba(255, 255, 255, 0.95); | |
924 | } | |
925 | ||
926 | @mixin on-small-main-col () { | |
927 | :host-context(.main-col:not(.expanded)) { | |
928 | @media screen and (max-width: $small-view + $menu-width) { | |
929 | @content; | |
930 | } | |
931 | } | |
932 | ||
933 | :host-context(.main-col.expanded) { | |
934 | @media screen and (max-width: $small-view) { | |
935 | @content; | |
936 | } | |
937 | } | |
938 | } | |
939 | ||
940 | @mixin on-mobile-main-col () { | |
941 | :host-context(.main-col:not(.expanded)) { | |
942 | @media screen and (max-width: $mobile-view + $menu-width) { | |
943 | @content; | |
944 | } | |
945 | } | |
946 | ||
947 | :host-context(.main-col.expanded) { | |
948 | @media screen and (max-width: $mobile-view) { | |
949 | @content; | |
950 | } | |
951 | } | |
952 | } | |
953 | ||
954 | @mixin margin ($block-start, $inline-end, $block-end, $inline-start) { | |
955 | @include margin-left($inline-start); | |
956 | @include margin-right($inline-end); | |
957 | ||
958 | margin-top: $block-start; | |
959 | margin-bottom: $block-end; | |
960 | } | |
961 | ||
962 | @mixin padding ($block-start, $inline-end, $block-end, $inline-start) { | |
963 | @include padding-left($inline-start); | |
964 | @include padding-right($inline-end); | |
965 | ||
966 | padding-top: $block-start; | |
967 | padding-bottom: $block-end; | |
968 | } | |
969 | ||
970 | @mixin margin-left ($value) { | |
971 | @supports (margin-inline-start: $value) { | |
972 | margin-inline-start: $value; | |
973 | } | |
974 | ||
975 | @supports not (margin-inline-start: $value) { | |
976 | margin-left: $value; | |
977 | } | |
978 | } | |
979 | ||
980 | @mixin margin-right ($value) { | |
981 | @supports (margin-inline-end: $value) { | |
982 | margin-inline-end: $value; | |
983 | } | |
984 | ||
985 | @supports not (margin-inline-end: $value) { | |
986 | margin-right: $value; | |
987 | } | |
988 | } | |
989 | ||
990 | @mixin padding-left ($value) { | |
991 | @supports (padding-inline-start: $value) { | |
992 | padding-inline-start: $value; | |
993 | } | |
994 | ||
995 | @supports not (padding-inline-start: $value) { | |
996 | padding-left: $value; | |
997 | } | |
998 | } | |
999 | ||
1000 | @mixin padding-right ($value) { | |
1001 | @supports (padding-inline-end: $value) { | |
1002 | padding-inline-end: $value; | |
1003 | } | |
1004 | ||
1005 | @supports not (padding-inline-end: $value) { | |
1006 | padding-right: $value; | |
1007 | } | |
1008 | } |