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