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