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