aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/sass/include/_mixins.scss
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/sass/include/_mixins.scss')
-rw-r--r--client/src/sass/include/_mixins.scss86
1 files changed, 52 insertions, 34 deletions
diff --git a/client/src/sass/include/_mixins.scss b/client/src/sass/include/_mixins.scss
index 0b558a3f5..5971bb72a 100644
--- a/client/src/sass/include/_mixins.scss
+++ b/client/src/sass/include/_mixins.scss
@@ -90,8 +90,8 @@
90 display: inline-block; 90 display: inline-block;
91 height: $button-height; 91 height: $button-height;
92 width: $width; 92 width: $width;
93 color: var(--inputForegroundColor); 93 color: pvar(--inputForegroundColor);
94 background-color: var(--inputBackgroundColor); 94 background-color: pvar(--inputBackgroundColor);
95 border: 1px solid #C6C6C6; 95 border: 1px solid #C6C6C6;
96 border-radius: 3px; 96 border-radius: 3px;
97 padding-left: 15px; 97 padding-left: 15px;
@@ -99,7 +99,7 @@
99 font-size: 15px; 99 font-size: 15px;
100 100
101 &::placeholder { 101 &::placeholder {
102 color: var(--inputPlaceholderColor); 102 color: pvar(--inputPlaceholderColor);
103 } 103 }
104 104
105 @media screen and (max-width: $width) { 105 @media screen and (max-width: $width) {
@@ -122,24 +122,24 @@
122@mixin peertube-textarea ($width, $height) { 122@mixin peertube-textarea ($width, $height) {
123 @include peertube-input-text($width); 123 @include peertube-input-text($width);
124 124
125 color: var(--textareaForegroundColor); 125 color: pvar(--textareaForegroundColor);
126 background-color: var(--textareaBackgroundColor); 126 background-color: pvar(--textareaBackgroundColor);
127 height: $height; 127 height: $height;
128 padding: 5px 15px; 128 padding: 5px 15px;
129 font-size: 15px; 129 font-size: 15px;
130} 130}
131 131
132@mixin orange-button { 132@mixin orange-button {
133 @include button-focus(var(--mainColorLightest)); 133 @include button-focus(pvar(--mainColorLightest));
134 134
135 &, &:active, &:focus { 135 &, &:active, &:focus {
136 color: #fff; 136 color: #fff;
137 background-color: var(--mainColor); 137 background-color: pvar(--mainColor);
138 } 138 }
139 139
140 &:hover { 140 &:hover {
141 color: #fff; 141 color: #fff;
142 background-color: var(--mainHoverColor); 142 background-color: pvar(--mainHoverColor);
143 } 143 }
144 144
145 &[disabled], &.disabled { 145 &[disabled], &.disabled {
@@ -156,7 +156,7 @@
156@mixin tertiary-button { 156@mixin tertiary-button {
157 @include button-focus($grey-button-outline-color); 157 @include button-focus($grey-button-outline-color);
158 158
159 color: var(--greyForegroundColor); 159 color: pvar(--greyForegroundColor);
160 background-color: transparent; 160 background-color: transparent;
161 161
162 &[disabled], &.disabled { 162 &[disabled], &.disabled {
@@ -173,11 +173,11 @@
173 173
174 &, &:active, &:focus { 174 &, &:active, &:focus {
175 background-color: $grey-background-color; 175 background-color: $grey-background-color;
176 color: var(--greyForegroundColor); 176 color: pvar(--greyForegroundColor);
177 } 177 }
178 178
179 &:hover, &:active, &:focus, &[disabled], &.disabled { 179 &:hover, &:active, &:focus, &[disabled], &.disabled {
180 color: var(--greyForegroundColor); 180 color: pvar(--greyForegroundColor);
181 background-color: $grey-background-hover-color; 181 background-color: $grey-background-hover-color;
182 } 182 }
183 183
@@ -186,7 +186,7 @@
186 } 186 }
187 187
188 my-global-icon { 188 my-global-icon {
189 @include apply-svg-color(var(--greyForegroundColor)) 189 @include apply-svg-color(pvar(--greyForegroundColor))
190 } 190 }
191} 191}
192 192
@@ -283,8 +283,8 @@
283 margin: 0; 283 margin: 0;
284 width: $width; 284 width: $width;
285 border-radius: 3px; 285 border-radius: 3px;
286 color: var(--inputForegroundColor); 286 color: pvar(--inputForegroundColor);
287 background: var(--inputBackgroundColor); 287 background: pvar(--inputBackgroundColor);
288 position: relative; 288 position: relative;
289 font-size: 15px; 289 font-size: 15px;
290 290
@@ -315,7 +315,7 @@
315 cursor: pointer; 315 cursor: pointer;
316 height: $button-height; 316 height: $button-height;
317 text-overflow: ellipsis; 317 text-overflow: ellipsis;
318 color: var(--mainForegroundColor); 318 color: pvar(--mainForegroundColor);
319 319
320 &:focus { 320 &:focus {
321 outline: none; 321 outline: none;
@@ -375,7 +375,7 @@
375 position: absolute; 375 position: absolute;
376 376
377 &:focus + span { 377 &:focus + span {
378 box-shadow: #{$focus-box-shadow-form} var(--mainColorLightest); 378 box-shadow: #{$focus-box-shadow-form} pvar(--mainColorLightest);
379 } 379 }
380 380
381 & + span { 381 & + span {
@@ -404,7 +404,7 @@
404 404
405 &:checked + span { 405 &:checked + span {
406 border-color: transparent; 406 border-color: transparent;
407 background: var(--mainColor); 407 background: pvar(--mainColor);
408 animation: jelly 0.6s ease; 408 animation: jelly 0.6s ease;
409 409
410 &:after { 410 &:after {
@@ -464,14 +464,14 @@
464 464
465@mixin in-content-small-title { 465@mixin in-content-small-title {
466 text-transform: uppercase; 466 text-transform: uppercase;
467 color: var(--mainColor); 467 color: pvar(--mainColor);
468 font-weight: $font-bold; 468 font-weight: $font-bold;
469 font-size: 13px; 469 font-size: 13px;
470} 470}
471 471
472@mixin settings-big-title { 472@mixin settings-big-title {
473 text-transform: uppercase; 473 text-transform: uppercase;
474 color: var(--mainColor); 474 color: pvar(--mainColor);
475 font-weight: $font-bold; 475 font-weight: $font-bold;
476 font-size: 110%; 476 font-size: 110%;
477 margin-bottom: 10px; 477 margin-bottom: 10px;
@@ -482,7 +482,7 @@
482 482
483 font-size: 13px; 483 font-size: 13px;
484 margin-top: 4px; 484 margin-top: 4px;
485 color: var(--mainForegroundColor); 485 color: pvar(--mainForegroundColor);
486 486
487 span:hover { 487 span:hover {
488 opacity: 0.8; 488 opacity: 0.8;
@@ -612,8 +612,8 @@
612 border-radius: 0.25rem; 612 border-radius: 0.25rem;
613 613
614 .progress-bar { 614 .progress-bar {
615 color: var(--mainBackgroundColor); 615 color: pvar(--mainBackgroundColor);
616 background-color: var(--mainColor); 616 background-color: pvar(--mainColor);
617 display: flex; 617 display: flex;
618 flex-direction: column; 618 flex-direction: column;
619 justify-content: center; 619 justify-content: center;
@@ -622,7 +622,7 @@
622 transition: width 0.6s ease; 622 transition: width 0.6s ease;
623 623
624 &.secondary { 624 &.secondary {
625 background-color: var(--secondaryColor); 625 background-color: pvar(--secondaryColor);
626 } 626 }
627 } 627 }
628} 628}
@@ -633,14 +633,14 @@
633 padding: 0.75rem 1rem; 633 padding: 0.75rem 1rem;
634 margin-bottom: 1rem; 634 margin-bottom: 1rem;
635 list-style: none; 635 list-style: none;
636 background-color: var(--submenuColor); 636 background-color: pvar(--submenuColor);
637 border-radius: 0.25rem; 637 border-radius: 0.25rem;
638 638
639 .breadcrumb-item { 639 .breadcrumb-item {
640 display: flex; 640 display: flex;
641 641
642 a { 642 a {
643 color: var(--mainColor); 643 color: pvar(--mainColor);
644 } 644 }
645 645
646 & + .breadcrumb-item { 646 & + .breadcrumb-item {
@@ -688,7 +688,7 @@
688 & > a, 688 & > a,
689 & > div { 689 & > div {
690 padding: 20px; 690 padding: 20px;
691 background: var(--submenuColor); 691 background: pvar(--submenuColor);
692 border-radius: 4px; 692 border-radius: 4px;
693 box-sizing: border-box; 693 box-sizing: border-box;
694 height: 100%; 694 height: 100%;
@@ -699,14 +699,14 @@
699 text-align: center; 699 text-align: center;
700 font-size: 130%; 700 font-size: 130%;
701 line-height: 21px; 701 line-height: 21px;
702 color: var(--mainForegroundColor); 702 color: pvar(--mainForegroundColor);
703 line-height: 30px; 703 line-height: 30px;
704 margin-bottom: 20px; 704 margin-bottom: 20px;
705 } 705 }
706 706
707 .dashboard-label { 707 .dashboard-label {
708 font-size: 90%; 708 font-size: 90%;
709 color: var(--inputPlaceholderColor); 709 color: pvar(--inputPlaceholderColor);
710 text-align: center; 710 text-align: center;
711 } 711 }
712} 712}
@@ -726,7 +726,7 @@
726 height: max-content; 726 height: max-content;
727 727
728 &:focus-within { 728 &:focus-within {
729 box-shadow: #{$focus-box-shadow-form} var(--mainColorLightest); 729 box-shadow: #{$focus-box-shadow-form} pvar(--mainColorLightest);
730 } 730 }
731 } 731 }
732 732
@@ -735,8 +735,8 @@
735 height: 30px !important; 735 height: 30px !important;
736 font-size: 12px !important; 736 font-size: 12px !important;
737 737
738 background-color: var(--mainBackgroundColor) !important; 738 background-color: pvar(--mainBackgroundColor) !important;
739 color: var(--mainForegroundColor) !important; 739 color: pvar(--mainForegroundColor) !important;
740 } 740 }
741 } 741 }
742 742
@@ -769,7 +769,7 @@
769 vertical-align: middle !important; 769 vertical-align: middle !important;
770 770
771 path { 771 path {
772 fill: var(--greyForegroundColor) !important; 772 fill: pvar(--greyForegroundColor) !important;
773 } 773 }
774 } 774 }
775 775
@@ -780,7 +780,7 @@
780 } 780 }
781} 781}
782 782
783@mixin divider($color: var(--submenuColor), $background: var(--mainBackgroundColor)) { 783@mixin divider($color: pvar(--submenuColor), $background: pvar(--mainBackgroundColor)) {
784 width: 95%; 784 width: 95%;
785 border-top: .05rem solid $color; 785 border-top: .05rem solid $color;
786 height: .05rem; 786 height: .05rem;
@@ -810,7 +810,7 @@
810 border-radius: 5rem; 810 border-radius: 5rem;
811 display: inline-flex; 811 display: inline-flex;
812 font-size: 90%; 812 font-size: 90%;
813 color: var(--mainForegroundColor); 813 color: pvar(--mainForegroundColor);
814 height: $avatar-height; 814 height: $avatar-height;
815 line-height: 1rem; 815 line-height: 1rem;
816 margin: .1rem; 816 margin: .1rem;
@@ -887,3 +887,21 @@
887 } 887 }
888 } 888 }
889} 889}
890
891// applies 16:9 ratio to a child element (using $selector) only using
892// an immediate's parent size. This allows 16:9 ratio without explicit
893// dimensions, as width/height cannot be computed from each other.
894@mixin large-screen-ratio ($selector: 'div') {
895 position: relative;
896 height: 0;
897 width: 100%;
898 padding-top: 56%;
899
900 #{$selector} {
901 position: absolute;
902 width: 100%;
903 height: 100%;
904 top: 0;
905 @content;
906 }
907}