]>
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; | |
e66883b3 RK |
92 | color: pvar(--inputForegroundColor); |
93 | background-color: pvar(--inputBackgroundColor); | |
c30745f3 C |
94 | border: 1px solid #C6C6C6; |
95 | border-radius: 3px; | |
17bb716b | 96 | font-size: 15px; |
9a0fc840 RK |
97 | |
98 | &::placeholder { | |
e66883b3 | 99 | color: pvar(--inputPlaceholderColor); |
9a0fc840 | 100 | } |
2860e62e | 101 | |
767bb14a C |
102 | &[readonly] { |
103 | opacity: 0.7; | |
104 | } | |
105 | ||
5c16e6bc | 106 | @media screen and (max-width: calc(#{$width} + 40px)) { |
2860e62e C |
107 | width: 100%; |
108 | } | |
8a19bee1 | 109 | } |
c30745f3 | 110 | |
8a19bee1 C |
111 | @mixin peertube-input-group($width) { |
112 | width: $width; | |
2a53942d | 113 | min-height: $button-height; |
8a19bee1 C |
114 | padding-top: 0; |
115 | padding-bottom: 0; | |
832a12b0 | 116 | flex-wrap: nowrap; |
8a19bee1 | 117 | |
931d3430 | 118 | .input-group-text { |
8a19bee1 | 119 | font-size: 14px; |
931d3430 | 120 | color: #808080; |
c30745f3 C |
121 | } |
122 | } | |
123 | ||
5f0805d3 C |
124 | @mixin peertube-textarea ($width, $height) { |
125 | @include peertube-input-text($width); | |
126 | ||
b788e691 C |
127 | color: pvar(--textareaForegroundColor) !important; |
128 | background-color: pvar(--textareaBackgroundColor) !important; | |
5f0805d3 C |
129 | height: $height; |
130 | padding: 5px 15px; | |
131 | font-size: 15px; | |
132 | } | |
133 | ||
7b272fd7 | 134 | @mixin orange-button { |
e66883b3 | 135 | @include button-focus(pvar(--mainColorLightest)); |
e40afb5b | 136 | |
931d3430 C |
137 | &, |
138 | &:active, | |
139 | &:focus { | |
15a7387d | 140 | color: #fff; |
e66883b3 | 141 | background-color: pvar(--mainColor); |
15a7387d | 142 | } |
7b272fd7 | 143 | |
15a7387d | 144 | &:hover { |
0727cab0 | 145 | color: #fff; |
e66883b3 | 146 | background-color: pvar(--mainHoverColor); |
7b272fd7 | 147 | } |
4cc66133 | 148 | |
931d3430 C |
149 | &[disabled], |
150 | &.disabled { | |
4cc66133 | 151 | cursor: default; |
cadb46d8 C |
152 | color: #fff; |
153 | background-color: #C6C6C6; | |
4cc66133 | 154 | } |
457bb213 C |
155 | |
156 | my-global-icon { | |
931d3430 | 157 | @include apply-svg-color(#fff); |
457bb213 | 158 | } |
7b272fd7 C |
159 | } |
160 | ||
60c35932 C |
161 | @mixin orange-button-inverted { |
162 | @include button-focus(pvar(--mainColorLightest)); | |
163 | ||
164 | border: 2px solid pvar(--mainColor); | |
733dbc53 | 165 | font-weight: $font-semibold; |
60c35932 | 166 | |
931d3430 C |
167 | &, |
168 | &:active, | |
169 | &:focus { | |
60c35932 C |
170 | color: pvar(--mainColor); |
171 | background-color: pvar(--mainBackgroundColor); | |
172 | } | |
173 | ||
174 | &:hover { | |
175 | color: pvar(--mainColor); | |
176 | background-color: pvar(--mainColorLightest); | |
177 | } | |
178 | ||
931d3430 C |
179 | &[disabled], |
180 | &.disabled { | |
60c35932 C |
181 | cursor: default; |
182 | color: pvar(--mainColor); | |
183 | background-color: #C6C6C6; | |
184 | } | |
185 | ||
186 | my-global-icon { | |
931d3430 | 187 | @include apply-svg-color(pvar(--mainColor)); |
60c35932 C |
188 | } |
189 | } | |
190 | ||
54e78847 | 191 | @mixin tertiary-button { |
a6d5ff76 RK |
192 | @include button-focus($grey-button-outline-color); |
193 | ||
e66883b3 | 194 | color: pvar(--greyForegroundColor); |
54e78847 RK |
195 | background-color: transparent; |
196 | ||
931d3430 C |
197 | &[disabled], |
198 | .disabled { | |
54e78847 RK |
199 | cursor: default; |
200 | } | |
201 | ||
202 | my-global-icon { | |
931d3430 | 203 | @include apply-svg-color(transparent); |
54e78847 RK |
204 | } |
205 | } | |
206 | ||
7b272fd7 | 207 | @mixin grey-button { |
a6d5ff76 | 208 | @include button-focus($grey-button-outline-color); |
26171379 | 209 | |
b788e691 | 210 | background-color: pvar(--greyBackgroundColor); |
1fe1e14c | 211 | color: pvar(--greyForegroundColor); |
7b272fd7 | 212 | |
931d3430 C |
213 | &:hover, |
214 | &:active, | |
215 | &:focus, | |
216 | &[disabled], | |
217 | &.disabled { | |
e66883b3 | 218 | color: pvar(--greyForegroundColor); |
b788e691 | 219 | background-color: pvar(--greySecondaryBackgroundColor); |
7b272fd7 | 220 | } |
4cc66133 | 221 | |
931d3430 C |
222 | &[disabled], |
223 | &.disabled { | |
4cc66133 C |
224 | cursor: default; |
225 | } | |
457bb213 C |
226 | |
227 | my-global-icon { | |
931d3430 | 228 | @include apply-svg-color(pvar(--greyForegroundColor)); |
457bb213 | 229 | } |
7b272fd7 C |
230 | } |
231 | ||
1fe1e14c RK |
232 | @mixin danger-button { |
233 | $color: lighten($color: #c54130, $amount: 10); | |
234 | $text: #fff6f5; | |
235 | ||
236 | @include button-focus(scale-color($color, $alpha: -95%)); | |
931d3430 | 237 | |
1fe1e14c RK |
238 | background-color: $color; |
239 | color: $text; | |
240 | ||
931d3430 C |
241 | &:hover, |
242 | &:active, | |
243 | &:focus, | |
244 | &[disabled], | |
245 | &.disabled { | |
1fe1e14c RK |
246 | background-color: lighten($color: $color, $amount: 10); |
247 | } | |
248 | ||
931d3430 C |
249 | &[disabled], |
250 | &.disabled { | |
1fe1e14c RK |
251 | cursor: default; |
252 | } | |
253 | ||
254 | my-global-icon { | |
931d3430 | 255 | @include apply-svg-color($text); |
1fe1e14c RK |
256 | } |
257 | } | |
258 | ||
c30745f3 | 259 | @mixin peertube-button { |
419b520c | 260 | padding: 0 13px; |
27bc9586 | 261 | |
931d3430 | 262 | border: 0; |
c30745f3 C |
263 | font-weight: $font-semibold; |
264 | font-size: 15px; | |
265 | height: $button-height; | |
266 | line-height: $button-height; | |
02b2e482 C |
267 | |
268 | // Because of primeng that redefines border-radius of all input[type="..."] | |
266947e5 | 269 | border-radius: 3px !important; |
02b2e482 | 270 | |
c30745f3 | 271 | text-align: center; |
c30745f3 | 272 | cursor: pointer; |
419b520c C |
273 | |
274 | my-global-icon + * { | |
275 | @include margin-right(4px); | |
276 | } | |
c30745f3 C |
277 | } |
278 | ||
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 | } | |
8d8a037e JB |
374 | select[disabled] { |
375 | background-color: #f9f9f9; | |
376 | } | |
2f4c784a | 377 | |
2c3abc4f C |
378 | @media screen and (max-width: $width) { |
379 | width: 100%; | |
380 | } | |
381 | ||
931d3430 | 382 | &::after { |
bc4c9cc1 C |
383 | top: 50%; |
384 | right: calc(0% + 15px); | |
385 | content: ' '; | |
386 | height: 0; | |
387 | width: 0; | |
388 | position: absolute; | |
389 | pointer-events: none; | |
390 | border: 5px solid rgba(0, 0, 0, 0); | |
391 | border-top-color: #000; | |
392 | margin-top: -2px; | |
393 | z-index: 100; | |
15a7387d C |
394 | } |
395 | ||
396 | select { | |
108af661 | 397 | padding: 0 35px 0 12px; |
15a7387d | 398 | position: relative; |
a6d5ff76 | 399 | border: 1px solid #C6C6C6; |
15a7387d C |
400 | background: transparent none; |
401 | appearance: none; | |
402 | cursor: pointer; | |
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; | |
463 | border: 1px solid #C6C6C6; | |
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; |
5fd3e00a | 510 | border: $border-width solid #C6C6C6; |
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 | ||
d91b23b1 | 556 | @mixin peertube-badge { |
654a188f RK |
557 | border-radius: 2px; |
558 | padding: 1/4em 1/2em; | |
559 | text-transform: uppercase; | |
560 | font-weight: $font-bold; | |
561 | font-size: 12px; | |
562 | letter-spacing: 1/3px; | |
563 | ||
564 | &.badge-banned, | |
565 | &.badge-red { | |
566 | background-color: #ffcdd2; | |
567 | color: #c63737; | |
568 | } | |
569 | ||
570 | &.badge-banned { | |
571 | text-decoration: line-through; | |
572 | } | |
573 | ||
574 | &.badge-yellow { | |
575 | background-color: #feedaf; | |
576 | color: #8a5340; | |
577 | } | |
578 | ||
579 | &.badge-brown { | |
580 | background-color: #ffd8b2; | |
581 | color: #805b36; | |
582 | } | |
583 | ||
584 | &.badge-green { | |
585 | background-color: #c8e6c9; | |
586 | color: #256029; | |
587 | } | |
588 | ||
589 | &.badge-blue { | |
590 | background-color: #b3e5fc; | |
591 | color: #23547b; | |
592 | } | |
593 | ||
594 | &.badge-purple { | |
595 | background-color: #eccfff; | |
596 | color: #694382; | |
597 | } | |
598 | } | |
4e8c8728 | 599 | |
746018f6 C |
600 | @mixin actor-avatar-size ($size) { |
601 | display: inline-block; | |
60c35932 C |
602 | width: $size; |
603 | height: $size; | |
604 | min-width: $size; | |
605 | min-height: $size; | |
606 | } | |
607 | ||
61cbafc1 C |
608 | @mixin actor-counters ($separator-margin: 10px) { |
609 | color: pvar(--greyForegroundColor); | |
610 | font-size: 16px; | |
611 | display: flex; | |
612 | align-items: center; | |
613 | ||
614 | > *:not(:last-child)::after { | |
615 | content: '•'; | |
616 | margin: 0 $separator-margin; | |
617 | color: pvar(--mainColor); | |
618 | } | |
619 | } | |
620 | ||
c6352f2c C |
621 | @mixin chevron ($size, $border-width) { |
622 | border-style: solid; | |
623 | border-width: $border-width $border-width 0 0; | |
624 | content: ''; | |
625 | display: inline-block; | |
626 | transform: rotate(-45deg); | |
627 | height: $size; | |
628 | width: $size; | |
629 | } | |
630 | ||
631 | @mixin chevron-right ($size, $border-width) { | |
632 | @include chevron($size, $border-width); | |
633 | ||
634 | left: 0; | |
635 | transform: rotate(45deg); | |
636 | } | |
637 | ||
638 | @mixin chevron-left ($size, $border-width) { | |
639 | @include chevron($size, $border-width); | |
640 | ||
641 | left: 0.25em; | |
642 | transform: rotate(-135deg); | |
643 | } | |
0626e7af C |
644 | |
645 | @mixin in-content-small-title { | |
646 | text-transform: uppercase; | |
e66883b3 | 647 | color: pvar(--mainColor); |
0626e7af C |
648 | font-weight: $font-bold; |
649 | font-size: 13px; | |
170726f5 C |
650 | } |
651 | ||
482fa503 RK |
652 | @mixin settings-big-title { |
653 | text-transform: uppercase; | |
e66883b3 | 654 | color: pvar(--mainColor); |
482fa503 RK |
655 | font-weight: $font-bold; |
656 | font-size: 110%; | |
657 | margin-bottom: 10px; | |
658 | } | |
659 | ||
457bb213 | 660 | @mixin create-button { |
08c1efbe C |
661 | @include peertube-button-link; |
662 | @include orange-button; | |
457bb213 | 663 | @include button-with-icon(20px, 5px, -1px); |
a4f99a76 | 664 | } |
22a16e36 | 665 | |
4beda9e1 | 666 | @mixin row-blocks ($column-responsive: true, $min-height: 130px, $separator: true) { |
22a16e36 | 667 | display: flex; |
4beda9e1 | 668 | min-height: $min-height; |
22a16e36 C |
669 | padding-bottom: 20px; |
670 | margin-bottom: 20px; | |
4beda9e1 C |
671 | |
672 | @if $separator { | |
673 | border-bottom: 1px solid #C6C6C6; | |
674 | } | |
22a16e36 | 675 | |
0f7407d9 C |
676 | @media screen and (max-width: $small-view) { |
677 | @if $column-responsive { | |
678 | flex-direction: column; | |
679 | height: auto; | |
680 | align-items: center; | |
681 | } @else { | |
682 | min-height: initial; | |
683 | padding-bottom: 10px; | |
684 | margin-bottom: 10px; | |
685 | } | |
22a16e36 | 686 | } |
6aff854c | 687 | } |
c5a1ae50 C |
688 | |
689 | @mixin dropdown-with-icon-item { | |
bc584963 | 690 | padding: 6px 15px; |
c5a1ae50 C |
691 | |
692 | my-global-icon { | |
27bc9586 C |
693 | @include margin-right(10px); |
694 | ||
bc584963 RK |
695 | width: 22px; |
696 | opacity: .7; | |
c5a1ae50 C |
697 | position: relative; |
698 | top: -2px; | |
699 | } | |
700 | } | |
e61151b0 | 701 | |
66927c05 | 702 | @mixin progressbar($small: false) { |
e61151b0 RK |
703 | background-color: $grey-background-color; |
704 | display: flex; | |
705 | height: 1rem; | |
706 | overflow: hidden; | |
707 | font-size: 0.75rem; | |
708 | border-radius: 0.25rem; | |
bc99dfe5 RK |
709 | position: relative; |
710 | ||
711 | span { | |
712 | position: absolute; | |
4f5d0459 | 713 | color: $grey-foreground-color; |
d94b8ecf | 714 | |
66927c05 RK |
715 | @if $small { |
716 | top: -1px; | |
717 | } | |
bc99dfe5 RK |
718 | |
719 | &:nth-of-type(1) { | |
720 | left: .2rem; | |
721 | } | |
722 | &:nth-of-type(2) { | |
723 | right: .2rem; | |
724 | } | |
725 | } | |
e61151b0 RK |
726 | |
727 | .progress-bar { | |
e66883b3 RK |
728 | color: pvar(--mainBackgroundColor); |
729 | background-color: pvar(--mainColor); | |
e61151b0 RK |
730 | display: flex; |
731 | flex-direction: column; | |
732 | justify-content: center; | |
733 | text-align: center; | |
734 | white-space: nowrap; | |
735 | transition: width 0.6s ease; | |
736 | ||
737 | &.secondary { | |
e66883b3 | 738 | background-color: pvar(--secondaryColor); |
e61151b0 | 739 | } |
d4132d3f RK |
740 | |
741 | &.red { | |
742 | background-color: lighten($color: #c54130, $amount: 10); | |
743 | } | |
e61151b0 RK |
744 | } |
745 | } | |
76314386 RK |
746 | |
747 | @mixin breadcrumb { | |
748 | display: flex; | |
749 | flex-wrap: wrap; | |
750 | padding: 0.75rem 1rem; | |
751 | margin-bottom: 1rem; | |
752 | list-style: none; | |
218f730c | 753 | background-color: pvar(--submenuBackgroundColor); |
76314386 RK |
754 | border-radius: 0.25rem; |
755 | ||
756 | .breadcrumb-item { | |
757 | display: flex; | |
758 | ||
759 | a { | |
e66883b3 | 760 | color: pvar(--mainColor); |
76314386 RK |
761 | } |
762 | ||
931d3430 | 763 | + .breadcrumb-item { |
27bc9586 C |
764 | @include padding-left(0.5rem); |
765 | ||
76314386 | 766 | &::before { |
27bc9586 C |
767 | @include padding-right(0.5rem); |
768 | ||
76314386 | 769 | display: inline-block; |
76314386 | 770 | color: #6c757d; |
931d3430 | 771 | content: '/'; |
76314386 RK |
772 | } |
773 | } | |
774 | ||
775 | &.active { | |
776 | color: #6c757d; | |
777 | } | |
778 | } | |
779 | } | |
780 | ||
781 | @mixin dashboard { | |
782 | display: flex; | |
783 | flex-wrap: wrap; | |
784 | margin: 0 -5px; | |
785 | ||
931d3430 | 786 | > div { |
76314386 | 787 | box-sizing: border-box; |
8cbc40b2 | 788 | flex: 0 0 percentage(math.div(1, 3)); |
76314386 RK |
789 | padding: 0 5px; |
790 | margin-bottom: 10px; | |
791 | ||
931d3430 | 792 | > a { |
d1261d9a RK |
793 | @include disable-default-a-behaviour; |
794 | ||
76314386 RK |
795 | text-decoration: none; |
796 | color: inherit; | |
797 | display: block; | |
798 | font-size: 18px; | |
799 | ||
800 | &:active, | |
801 | &:focus, | |
802 | &:hover { | |
803 | opacity: .8; | |
804 | } | |
805 | } | |
806 | ||
931d3430 C |
807 | > a, |
808 | > div { | |
76314386 | 809 | padding: 20px; |
218f730c | 810 | background: pvar(--submenuBackgroundColor); |
76314386 RK |
811 | border-radius: 4px; |
812 | box-sizing: border-box; | |
813 | height: 100%; | |
814 | } | |
815 | } | |
816 | ||
931d3430 C |
817 | .dashboard-num, |
818 | .dashboard-text { | |
76314386 RK |
819 | text-align: center; |
820 | font-size: 130%; | |
e66883b3 | 821 | color: pvar(--mainForegroundColor); |
76314386 RK |
822 | line-height: 30px; |
823 | margin-bottom: 20px; | |
824 | } | |
825 | ||
826 | .dashboard-label { | |
827 | font-size: 90%; | |
e66883b3 | 828 | color: pvar(--inputPlaceholderColor); |
76314386 RK |
829 | text-align: center; |
830 | } | |
831 | } | |
a6d5ff76 | 832 | |
218f730c | 833 | @mixin divider($color: pvar(--submenuBackgroundColor), $background: pvar(--mainBackgroundColor)) { |
b515c98c RK |
834 | width: 95%; |
835 | border-top: .05rem solid $color; | |
836 | height: .05rem; | |
837 | text-align: center; | |
838 | display: block; | |
839 | position: relative; | |
840 | ||
841 | &[data-content] { | |
842 | margin: .8rem 0; | |
843 | ||
844 | &::after { | |
845 | background: $background; | |
846 | color: $color; | |
847 | content: attr(data-content); | |
848 | display: inline-block; | |
849 | font-size: .7rem; | |
850 | padding: 0 .4rem; | |
851 | transform: translateY(-.65rem); | |
852 | } | |
853 | } | |
854 | } | |
d6af8146 RK |
855 | |
856 | @mixin chip { | |
1ebddadd RK |
857 | --chip-radius: 5rem; |
858 | --chip-padding: .2rem .4rem; | |
d6af8146 RK |
859 | $avatar-height: 1.2rem; |
860 | ||
861 | align-items: center; | |
1ebddadd | 862 | border-radius: var(--chip-radius); |
d6af8146 RK |
863 | display: inline-flex; |
864 | font-size: 90%; | |
e66883b3 | 865 | color: pvar(--mainForegroundColor); |
d6af8146 | 866 | height: $avatar-height; |
06827932 | 867 | line-height: 1rem; |
d6af8146 RK |
868 | margin: .1rem; |
869 | max-width: 320px; | |
870 | overflow: hidden; | |
1ebddadd | 871 | padding: var(--chip-padding); |
d6af8146 RK |
872 | text-decoration: none; |
873 | text-overflow: ellipsis; | |
874 | vertical-align: middle; | |
875 | white-space: nowrap; | |
876 | ||
1ebddadd RK |
877 | &.rectangular { |
878 | --chip-radius: .2rem; | |
879 | --chip-padding: .2rem .3rem; | |
880 | } | |
881 | ||
f6e98f0a | 882 | my-actor-avatar { |
27bc9586 C |
883 | @include margin-left(-.4rem); |
884 | @include margin-right(.2rem); | |
d6af8146 RK |
885 | } |
886 | ||
887 | &.two-lines { | |
36f772fd | 888 | $avatar-height: 2rem; |
d6af8146 RK |
889 | |
890 | height: $avatar-height; | |
891 | ||
f6e98f0a | 892 | my-actor-avatar { |
d0800f76 | 893 | display: inline-block; |
d6af8146 RK |
894 | } |
895 | ||
896 | div { | |
27bc9586 C |
897 | margin: 0 .1rem; |
898 | ||
d6af8146 RK |
899 | display: flex; |
900 | flex-direction: column; | |
d6af8146 | 901 | height: $avatar-height; |
d6af8146 RK |
902 | justify-content: center; |
903 | } | |
904 | } | |
905 | } | |
7a03209d | 906 | |
cdeddff1 C |
907 | // applies ratio (default to 16:9) to a child element (using $selector) only using |
908 | // an immediate's parent size. This allows to set a ratio without explicit | |
e66883b3 | 909 | // dimensions, as width/height cannot be computed from each other. |
8cbc40b2 | 910 | @mixin block-ratio ($selector: 'div', $inverted-ratio: math.div(9, 16)) { |
cdeddff1 C |
911 | $padding-percent: percentage($inverted-ratio); |
912 | ||
e66883b3 RK |
913 | position: relative; |
914 | height: 0; | |
915 | width: 100%; | |
cdeddff1 | 916 | padding-top: $padding-percent; |
e66883b3 RK |
917 | |
918 | #{$selector} { | |
919 | position: absolute; | |
920 | width: 100%; | |
921 | height: 100%; | |
922 | top: 0; | |
37a44fc9 | 923 | |
e66883b3 RK |
924 | @content; |
925 | } | |
926 | } | |
ed5bb517 K |
927 | |
928 | @mixin sub-menu-h1 { | |
929 | ::ng-deep h1 { | |
930 | font-size: 1.3rem; | |
931 | border-bottom: 2px solid $grey-background-color; | |
932 | padding-bottom: 15px; | |
933 | margin-bottom: $sub-menu-margin-bottom; | |
934 | ||
cd262619 | 935 | > span > my-global-icon, |
205e4f56 | 936 | > my-global-icon { |
27bc9586 | 937 | @include margin-right(10px); |
ed5bb517 K |
938 | width: 24px; |
939 | height: 24px; | |
cd262619 | 940 | vertical-align: top; |
ed5bb517 K |
941 | } |
942 | ||
943 | .badge { | |
27bc9586 | 944 | @include margin-left(7px); |
cd262619 | 945 | vertical-align: top; |
ed5bb517 K |
946 | } |
947 | } | |
948 | } | |
4572c3d0 C |
949 | |
950 | @mixin play-icon ($width, $height) { | |
951 | width: 0; | |
952 | height: 0; | |
953 | ||
954 | position: absolute; | |
955 | left: 50%; | |
956 | top: 50%; | |
957 | transform: translate(-50%, -50%) scale(0.5); | |
958 | ||
8cbc40b2 C |
959 | border-top: #{math.div($height, 2)} solid transparent; |
960 | border-bottom: #{math.div($height, 2)} solid transparent; | |
4572c3d0 C |
961 | |
962 | border-left: $width solid rgba(255, 255, 255, 0.95); | |
963 | } | |
0f7407d9 C |
964 | |
965 | @mixin on-small-main-col () { | |
966 | :host-context(.main-col:not(.expanded)) { | |
967 | @media screen and (max-width: $small-view + $menu-width) { | |
968 | @content; | |
969 | } | |
970 | } | |
971 | ||
972 | :host-context(.main-col.expanded) { | |
973 | @media screen and (max-width: $small-view) { | |
974 | @content; | |
975 | } | |
976 | } | |
977 | } | |
978 | ||
979 | @mixin on-mobile-main-col () { | |
980 | :host-context(.main-col:not(.expanded)) { | |
981 | @media screen and (max-width: $mobile-view + $menu-width) { | |
982 | @content; | |
983 | } | |
984 | } | |
985 | ||
986 | :host-context(.main-col.expanded) { | |
987 | @media screen and (max-width: $mobile-view) { | |
988 | @content; | |
989 | } | |
990 | } | |
991 | } | |
27bc9586 C |
992 | |
993 | @mixin margin ($block-start, $inline-end, $block-end, $inline-start) { | |
994 | @include margin-left($inline-start); | |
995 | @include margin-right($inline-end); | |
996 | ||
997 | margin-top: $block-start; | |
998 | margin-bottom: $block-end; | |
999 | } | |
1000 | ||
1001 | @mixin padding ($block-start, $inline-end, $block-end, $inline-start) { | |
1002 | @include padding-left($inline-start); | |
1003 | @include padding-right($inline-end); | |
1004 | ||
1005 | padding-top: $block-start; | |
1006 | padding-bottom: $block-end; | |
1007 | } | |
1008 | ||
1009 | @mixin margin-left ($value) { | |
1010 | @supports (margin-inline-start: $value) { | |
1011 | margin-inline-start: $value; | |
1012 | } | |
1013 | ||
1014 | @supports not (margin-inline-start: $value) { | |
1015 | margin-left: $value; | |
1016 | } | |
1017 | } | |
1018 | ||
1019 | @mixin margin-right ($value) { | |
1020 | @supports (margin-inline-end: $value) { | |
1021 | margin-inline-end: $value; | |
1022 | } | |
1023 | ||
1024 | @supports not (margin-inline-end: $value) { | |
1025 | margin-right: $value; | |
1026 | } | |
1027 | } | |
1028 | ||
1029 | @mixin padding-left ($value) { | |
1030 | @supports (padding-inline-start: $value) { | |
1031 | padding-inline-start: $value; | |
1032 | } | |
1033 | ||
1034 | @supports not (padding-inline-start: $value) { | |
1035 | padding-left: $value; | |
1036 | } | |
1037 | } | |
1038 | ||
1039 | @mixin padding-right ($value) { | |
1040 | @supports (padding-inline-end: $value) { | |
1041 | padding-inline-end: $value; | |
1042 | } | |
1043 | ||
1044 | @supports not (padding-inline-end: $value) { | |
1045 | padding-right: $value; | |
1046 | } | |
1047 | } |