diff options
author | Wicklow <wicklow@framasoft.org> | 2023-02-16 12:30:30 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2023-02-20 13:52:22 +0100 |
commit | 27f84cc3371aaf519c1bb5c0cca9e728a9dd3967 (patch) | |
tree | c45e780589ea69f0a9842c90af58e22fe32749f4 /client/src/sass/class-helpers | |
parent | 6b13ba9b808059fec4398ee3b38c8197d8c41fb9 (diff) | |
download | PeerTube-27f84cc3371aaf519c1bb5c0cca9e728a9dd3967.tar.gz PeerTube-27f84cc3371aaf519c1bb5c0cca9e728a9dd3967.tar.zst PeerTube-27f84cc3371aaf519c1bb5c0cca9e728a9dd3967.zip |
Refactoring class helpers + add bootstrap mixins
Diffstat (limited to 'client/src/sass/class-helpers')
-rw-r--r-- | client/src/sass/class-helpers/_buttons.scss | 37 | ||||
-rw-r--r-- | client/src/sass/class-helpers/_common.scss | 123 | ||||
-rw-r--r-- | client/src/sass/class-helpers/_custom-bootstrap-helpers.scss | 36 | ||||
-rw-r--r-- | client/src/sass/class-helpers/_forms.scss | 55 | ||||
-rw-r--r-- | client/src/sass/class-helpers/_menu.scss | 80 | ||||
-rw-r--r-- | client/src/sass/class-helpers/index.scss | 10 |
6 files changed, 341 insertions, 0 deletions
diff --git a/client/src/sass/class-helpers/_buttons.scss b/client/src/sass/class-helpers/_buttons.scss new file mode 100644 index 000000000..61fdbbf70 --- /dev/null +++ b/client/src/sass/class-helpers/_buttons.scss | |||
@@ -0,0 +1,37 @@ | |||
1 | @use '_mixins' as *; | ||
2 | |||
3 | .peertube-button { | ||
4 | @include peertube-button; | ||
5 | } | ||
6 | |||
7 | .peertube-button-big { | ||
8 | @include peertube-button-big; | ||
9 | } | ||
10 | |||
11 | .peertube-button-link { | ||
12 | @include peertube-button-link; | ||
13 | } | ||
14 | |||
15 | .peertube-button-big-link { | ||
16 | @include peertube-button-big-link; | ||
17 | } | ||
18 | |||
19 | .orange-button { | ||
20 | @include orange-button; | ||
21 | } | ||
22 | |||
23 | .orange-button-inverted { | ||
24 | @include orange-button-inverted; | ||
25 | } | ||
26 | |||
27 | .grey-button { | ||
28 | @include grey-button; | ||
29 | } | ||
30 | |||
31 | .tertiary-button { | ||
32 | @include tertiary-button; | ||
33 | } | ||
34 | |||
35 | .peertube-radio-container { | ||
36 | @include peertube-radio-container; | ||
37 | } \ No newline at end of file | ||
diff --git a/client/src/sass/class-helpers/_common.scss b/client/src/sass/class-helpers/_common.scss new file mode 100644 index 000000000..182c51c8f --- /dev/null +++ b/client/src/sass/class-helpers/_common.scss | |||
@@ -0,0 +1,123 @@ | |||
1 | @use '_variables' as *; | ||
2 | @use '_mixins' as *; | ||
3 | @use '_badges' as *; | ||
4 | @use '_icons' as *; | ||
5 | |||
6 | .link-orange { | ||
7 | color: pvar(--mainForegroundColor); | ||
8 | font-weight: $font-semibold; | ||
9 | border-bottom: 0.18em solid pvar(--mainColor); | ||
10 | display: inline-block; | ||
11 | line-height: 1.1; | ||
12 | |||
13 | &:hover { | ||
14 | color: pvar(--mainForegroundColor); | ||
15 | opacity: 0.8; | ||
16 | } | ||
17 | } | ||
18 | |||
19 | .underline-orange { | ||
20 | display: inline-block; | ||
21 | border-bottom: 0.19em solid pvar(--mainColor); | ||
22 | } | ||
23 | |||
24 | // --------------------------------------------------------------------------- | ||
25 | |||
26 | .muted { | ||
27 | @include muted; | ||
28 | } | ||
29 | |||
30 | // --------------------------------------------------------------------------- | ||
31 | |||
32 | .pt-badge { | ||
33 | @include peertube-badge; | ||
34 | } | ||
35 | |||
36 | // --------------------------------------------------------------------------- | ||
37 | |||
38 | .no-results { | ||
39 | height: 40vh; | ||
40 | max-height: 500px; | ||
41 | |||
42 | display: flex; | ||
43 | flex-direction: column; | ||
44 | align-items: center; | ||
45 | justify-content: center; | ||
46 | font-weight: $font-semibold; | ||
47 | } | ||
48 | |||
49 | // --------------------------------------------------------------------------- | ||
50 | |||
51 | .chevron-down { | ||
52 | @include chevron-down-default; | ||
53 | } | ||
54 | |||
55 | .chevron-up { | ||
56 | @include chevron-up-default; | ||
57 | } | ||
58 | |||
59 | .chevron-right { | ||
60 | @include chevron-right-default; | ||
61 | } | ||
62 | |||
63 | .chevron-left { | ||
64 | @include chevron-left-default; | ||
65 | } | ||
66 | |||
67 | // --------------------------------------------------------------------------- | ||
68 | |||
69 | .callout { | ||
70 | padding: 1.25rem; | ||
71 | border: 1px solid #eee; | ||
72 | border-radius: 0.25rem; | ||
73 | position: relative; | ||
74 | |||
75 | >label { | ||
76 | position: relative; | ||
77 | top: -5px; | ||
78 | left: -10px; | ||
79 | color: #6c757d !important; | ||
80 | } | ||
81 | |||
82 | &:not(.callout-light) { | ||
83 | border-left-width: 0.25rem; | ||
84 | } | ||
85 | |||
86 | &.callout-orange { | ||
87 | border-color: pvar(--mainColorLightest); | ||
88 | |||
89 | &:not(.callout-light) { | ||
90 | border-left-color: pvar(--mainColor); | ||
91 | } | ||
92 | } | ||
93 | } | ||
94 | |||
95 | // --------------------------------------------------------------------------- | ||
96 | |||
97 | .anchor { | ||
98 | position: relative; | ||
99 | top: #{- ($header-height + 20px)}; | ||
100 | } | ||
101 | |||
102 | .offset-content { | ||
103 | |||
104 | // if sub-menu fixed | ||
105 | .anchor { | ||
106 | top: #{- ($header-height + $sub-menu-height + 20px)}; | ||
107 | } | ||
108 | } | ||
109 | |||
110 | // --------------------------------------------------------------------------- | ||
111 | |||
112 | .alert { | ||
113 | &.pt-alert-primary { | ||
114 | background-color: pvar(--mainColorVeryLight); | ||
115 | border: 2px solid pvar(--mainColorLightest); | ||
116 | } | ||
117 | } | ||
118 | |||
119 | // --------------------------------------------------------------------------- | ||
120 | |||
121 | .chip { | ||
122 | @include chip; | ||
123 | } \ No newline at end of file | ||
diff --git a/client/src/sass/class-helpers/_custom-bootstrap-helpers.scss b/client/src/sass/class-helpers/_custom-bootstrap-helpers.scss new file mode 100644 index 000000000..78c4d30df --- /dev/null +++ b/client/src/sass/class-helpers/_custom-bootstrap-helpers.scss | |||
@@ -0,0 +1,36 @@ | |||
1 | @use '_variables' as *; | ||
2 | @use '_mixins' as *; | ||
3 | |||
4 | // Font sizes | ||
5 | |||
6 | .pt-fs-1 { | ||
7 | @include font-size(2.5rem); | ||
8 | } | ||
9 | |||
10 | .pt-fs-2 { | ||
11 | @include font-size(2rem); | ||
12 | } | ||
13 | |||
14 | .pt-fs-3 { | ||
15 | @include font-size(1.75rem); | ||
16 | } | ||
17 | |||
18 | .pt-fs-4 { | ||
19 | @include font-size(1.5rem); | ||
20 | } | ||
21 | |||
22 | .pt-fs-5 { | ||
23 | @include font-size(1.25rem); | ||
24 | } | ||
25 | |||
26 | .pt-fs-5-5 { | ||
27 | @include font-size(1.125rem); | ||
28 | } | ||
29 | |||
30 | .pt-fs-6 { | ||
31 | @include font-size(1rem); | ||
32 | } | ||
33 | |||
34 | .pt-fs-7 { | ||
35 | @include font-size(0.875rem); | ||
36 | } \ No newline at end of file | ||
diff --git a/client/src/sass/class-helpers/_forms.scss b/client/src/sass/class-helpers/_forms.scss new file mode 100644 index 000000000..79495aeb4 --- /dev/null +++ b/client/src/sass/class-helpers/_forms.scss | |||
@@ -0,0 +1,55 @@ | |||
1 | @use '_variables' as *; | ||
2 | @use '_mixins' as *; | ||
3 | |||
4 | .form-group { | ||
5 | margin-bottom: 1rem; | ||
6 | } | ||
7 | |||
8 | .input-error:not(:focus) { | ||
9 | |||
10 | &, | ||
11 | +.nav-preview, | ||
12 | // Markdown textarea | ||
13 | +*+.tab-content { | ||
14 | border-color: $red !important; | ||
15 | } | ||
16 | } | ||
17 | |||
18 | .input-group .input-error { | ||
19 | z-index: 3; | ||
20 | } | ||
21 | |||
22 | .form-error, | ||
23 | .form-warning { | ||
24 | display: block; | ||
25 | margin-top: 5px; | ||
26 | font-size: 0.9em; | ||
27 | } | ||
28 | |||
29 | .form-error { | ||
30 | color: $red; | ||
31 | } | ||
32 | |||
33 | // Disable red error on input focus | ||
34 | .input-error:focus, | ||
35 | .input-group:focus-within { | ||
36 | |||
37 | +.form-error, | ||
38 | +*+.form-error, | ||
39 | // Markdown textarea | ||
40 | +*+*+.form-error { | ||
41 | color: pvar(--mainForegroundColor); | ||
42 | } | ||
43 | } | ||
44 | |||
45 | .form-group-description { | ||
46 | @include muted; | ||
47 | |||
48 | font-size: 14px; | ||
49 | margin-top: 10px; | ||
50 | } | ||
51 | |||
52 | label+.form-group-description { | ||
53 | margin-bottom: 10px; | ||
54 | margin-top: 0; | ||
55 | } \ No newline at end of file | ||
diff --git a/client/src/sass/class-helpers/_menu.scss b/client/src/sass/class-helpers/_menu.scss new file mode 100644 index 000000000..1d17f9f2e --- /dev/null +++ b/client/src/sass/class-helpers/_menu.scss | |||
@@ -0,0 +1,80 @@ | |||
1 | @use '_variables' as *; | ||
2 | @use '_mixins' as *; | ||
3 | |||
4 | .sub-menu-entry { | ||
5 | @include disable-default-a-behaviour; | ||
6 | @include margin-right(55px); | ||
7 | |||
8 | opacity: 0.7; | ||
9 | color: pvar(--mainForegroundColor); | ||
10 | display: inline-block; | ||
11 | font-weight: $font-semibold; | ||
12 | border-bottom: 2px solid transparent; | ||
13 | white-space: nowrap; | ||
14 | font-size: 1rem; | ||
15 | |||
16 | &.active { | ||
17 | border-bottom-color: pvar(--mainColor); | ||
18 | } | ||
19 | |||
20 | &:hover, | ||
21 | &:active, | ||
22 | &:focus { | ||
23 | color: pvar(--mainForegroundColor); | ||
24 | } | ||
25 | |||
26 | &.active, | ||
27 | &:hover, | ||
28 | &:active, | ||
29 | &:focus { | ||
30 | opacity: 1; | ||
31 | outline: 0 hidden !important; | ||
32 | } | ||
33 | |||
34 | @media screen and (max-width: $mobile-view) { | ||
35 | @include margin-left(15px); | ||
36 | } | ||
37 | } | ||
38 | |||
39 | .title-page-v2 { | ||
40 | font-weight: normal; | ||
41 | font-size: 15px; | ||
42 | padding: 35px 25px; | ||
43 | } | ||
44 | |||
45 | .title-page { | ||
46 | @include margin-right(55px); | ||
47 | |||
48 | margin-top: 30px; | ||
49 | margin-bottom: 25px; | ||
50 | |||
51 | color: pvar(--mainForegroundColor); | ||
52 | display: inline-block; | ||
53 | font-weight: $font-semibold; | ||
54 | font-size: 1.25rem; | ||
55 | |||
56 | a { | ||
57 | @include disable-default-a-behaviour; | ||
58 | |||
59 | color: inherit; | ||
60 | |||
61 | &:hover { | ||
62 | color: inherit; | ||
63 | opacity: 0.8; | ||
64 | } | ||
65 | } | ||
66 | |||
67 | @media screen and (max-width: $mobile-view) { | ||
68 | @include margin-left(15px); | ||
69 | } | ||
70 | } | ||
71 | |||
72 | .admin-sub-header { | ||
73 | display: flex; | ||
74 | align-items: center; | ||
75 | margin-bottom: 30px; | ||
76 | |||
77 | @media screen and (max-width: $small-view) { | ||
78 | flex-direction: column; | ||
79 | } | ||
80 | } \ No newline at end of file | ||
diff --git a/client/src/sass/class-helpers/index.scss b/client/src/sass/class-helpers/index.scss new file mode 100644 index 000000000..ad5fd7838 --- /dev/null +++ b/client/src/sass/class-helpers/index.scss | |||
@@ -0,0 +1,10 @@ | |||
1 | @use '_variables' as *; | ||
2 | @use '_mixins' as *; | ||
3 | @use '_badges' as *; | ||
4 | @use '_icons' as *; | ||
5 | @use '_fonts' as *; | ||
6 | @use '_menu' as *; | ||
7 | @use '_buttons' as *; | ||
8 | @use '_forms' as *; | ||
9 | @use '_common' as *; | ||
10 | @use '_custom-bootstrap-helpers' as *; \ No newline at end of file | ||