]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/sass/application.scss
58e77adace1d7641e253db2d697146ccb09ff5ea
[github/Chocobozzz/PeerTube.git] / client / src / sass / application.scss
1 @use 'sass:math';
2
3 @use '_variables' as *;
4 @use '_mixins' as *;
5 @use '_icons' as *;
6
7 @use '_fonts';
8
9 @use './class-helpers';
10 @use './custom-markup';
11 @use './ng-select';
12
13 @import './bootstrap';
14 @import './primeng-custom';
15
16 @import './z-index';
17
18 [hidden] {
19 display: none !important;
20 }
21
22 body {
23 /*** theme ***/
24 // now beware sass requires interpolation
25 // for css custom properties #{$var}
26 --mainColor: #{$main-color};
27 --mainColorLighter: #{$main-color-lighter};
28 --mainColorLightest: #{$main-color-lightest};
29
30 --mainHoverColor: #{$main-hover-color};
31 --mainBackgroundHoverColor: #{$main-background-hover-color};
32
33 --mainBackgroundColor: #{$bg-color};
34 --mainForegroundColor: #{$fg-color};
35
36 --greyForegroundColor: #{$grey-foreground-color};
37 --greyBackgroundColor: #{$grey-background-color};
38 --greySecondaryBackgroundColor: #{$grey-background-hover-color};
39
40 --menuBackgroundColor: #{$menu-background};
41 --menuForegroundColor: #{$menu-color};
42
43 --submenuBackgroundColor: #{$sub-menu-background-color};
44 --channelBackgroundColor: #{$channel-background-color};
45
46 --inputForegroundColor: #{$input-foreground-color};
47 --inputBackgroundColor: #{$input-background-color};
48 --inputPlaceholderColor: #{$input-placeholder-color};
49
50 --textareaForegroundColor: #{$textarea-foreground-color};
51 --textareaBackgroundColor: #{$textarea-background-color};
52 --markdownTextareaBackgroundColor: #{$markdown-textarea-background-color};
53
54 --actionButtonColor: #{$grey-foreground-color};
55
56 --supportButtonBackgroundColor: #{transparent};
57 --supportButtonColor: #{pvar(--actionButtonColor)};
58 --supportButtonHeartColor: #{$support-button-heart};
59
60 --activatedActionButtonColor: #{$activated-action-button-color};
61
62 --horizontalMarginContent: #{$not-expanded-horizontal-margins};
63 --videosHorizontalMarginContent: 6vw;
64 --mainColWidth: calc(100vw - #{$menu-width});
65
66 font-family: $main-fonts;
67 font-weight: $font-regular;
68 color: pvar(--mainForegroundColor);
69 background-color: pvar(--mainBackgroundColor);
70 font-size: 14px;
71 // On desktop browsers, make sure vertical scroll bar is always visible
72 // Allow to disable the scrollbar instead of hide it when the content fit the body
73 // And not move the content and header horizontally sticked to right when the content is updating
74 overflow-y: scroll;
75
76 // Fix "reboot" style that set text-align: left
77 text-align: start;
78 }
79
80 ::selection {
81 color: pvar(--mainBackgroundColor);
82 background-color: pvar(--mainHoverColor);
83 }
84
85 noscript,
86 #incompatible-browser {
87 display: block;
88 font-size: 1.2rem;
89 max-width: 600px;
90 margin: 1rem auto;
91 }
92
93 a {
94 text-decoration: none;
95 }
96
97 strong {
98 font-weight: $font-semibold;
99 }
100
101 input[readonly] {
102 /* Force blank on readonly inputs */
103 background-color: pvar(--inputBackgroundColor) !important;
104 }
105
106 input,
107 textarea {
108 outline: none;
109 color: pvar(--inputForegroundColor);
110 }
111
112 button {
113 @include disable-outline;
114
115 background: unset;
116 }
117
118 label {
119 font-weight: $font-bold;
120 font-size: 15px;
121 margin-bottom: 0.5rem;
122 }
123
124 code {
125 background-color: pvar(--greyBackgroundColor);
126 color: pvar(--greyForegroundColor);
127 border-radius: 3px;
128 padding: .2em .4em;
129 margin: auto .4em;
130 font-size: 75%;
131 display: inline-block;
132 vertical-align: middle;
133 }
134
135 .main-col {
136 @include margin-left($menu-width);
137
138 width: calc(100% - #{$menu-width});
139 outline: none;
140
141 .margin-content {
142 margin: 0 pvar(--horizontalMarginContent);
143 flex-grow: 1;
144 }
145
146 .sub-menu {
147 background-color: pvar(--submenuBackgroundColor);
148 width: 100%;
149 display: flex;
150 align-items: center;
151 padding: 0 pvar(--horizontalMarginContent);
152 height: $sub-menu-height;
153 margin-bottom: $sub-menu-margin-bottom;
154 overflow-x: auto;
155
156 &.sub-menu-fixed {
157 position: fixed;
158 z-index: #{z('sub-menu') - 1};
159 max-width: pvar(--mainColWidth);
160 }
161 }
162
163 // Use an appropriate offset top when sub-menu fixed
164 .margin-content.offset-content {
165 padding-top: $sub-menu-height + $sub-menu-margin-bottom;
166 }
167
168 // Override some properties if the main content is expanded (no menu on the left)
169 &.expanded {
170 --horizontalMarginContent: #{$expanded-horizontal-margins};
171 --mainColWidth: 100vw;
172
173 @include margin-left(0);
174 width: 100%;
175 }
176
177 &.lock-scroll .main-row > router-outlet + * { /* stylelint-disable-line selector-max-compound-selectors */
178 // Lock and hide body scrollbars
179 position: fixed;
180
181 // Lock and hide sub-menu scrollbars
182 .sub-menu { /* stylelint-disable-line */
183 overflow-x: hidden;
184 }
185 }
186 }
187
188 // In tables, don't have a hover different background
189 table {
190 my-edit-button,
191 my-delete-button {
192 .action-button {
193 &:hover,
194 &:active,
195 &:focus,
196 &[disabled],
197 &.disabled {
198 background-color: pvar(--greyBackgroundColor) !important;
199 opacity: 0.8;
200 }
201 }
202 }
203 }
204
205 .dropdown-item {
206 @include dropdown-with-icon-item;
207
208 my-global-icon {
209 width: 22px;
210 height: 22px;
211 }
212 }
213
214 my-global-icon[iconName=external-link] {
215 margin: 0 3px;
216 width: 13px;
217 vertical-align: text-bottom;
218 color: pvar(--inputPlaceholderColor);
219 }
220
221 @media screen and (max-width: #{breakpoint(xxl)}) {
222 .main-col {
223 --horizontalMarginContent: #{math.div($not-expanded-horizontal-margins, 2)};
224 --videosHorizontalMarginContent: 30px;
225
226 &.expanded {
227 --horizontalMarginContent: #{math.div($expanded-horizontal-margins, 2)};
228 }
229 }
230 }
231
232 @media screen and (max-width: #{breakpoint(lg)}) {
233 .main-col {
234 --videosHorizontalMarginContent: #{pvar(--horizontalMarginContent)};
235 }
236
237 /* the following applies from 500px to 900px and is partially overridden from 500px to 800px by changes below to $small-view */
238 .main-col,
239 .main-col.expanded {
240 --horizontalMarginContent: #{math.div($expanded-horizontal-margins, 3)};
241
242 .sub-menu {
243 padding: 0 50px;
244
245 .title-page {
246 font-size: 17px;
247 }
248 }
249 }
250 }
251
252 @media screen and (min-width: $mobile-view) and (max-width: $small-view) {
253 .main-col {
254 width: 100%;
255 }
256 }
257
258 @media screen and (max-width: $small-view) {
259 .main-col,
260 .main-col.expanded {
261 --horizontalMarginContent: 15px;
262
263 @include margin-left(0);
264
265 .sub-menu {
266 width: 100vw;
267 padding: 0 15px;
268 margin-bottom: $sub-menu-margin-bottom-small-view;
269 overflow-x: auto;
270 }
271
272 // Use an appropriate offset top when sub-menu fixed
273 .margin-content.offset-content {
274 padding-top: $sub-menu-height + $sub-menu-margin-bottom-small-view;
275 }
276
277 my-markdown-textarea {
278 .root {
279 max-width: 100% !important;
280 }
281 }
282
283 input[type=text],
284 input[type=password],
285 input[type=email],
286 textarea,
287 .peertube-select-container {
288 flex-grow: 1;
289 }
290
291 .caption input[type=text] {
292 width: unset !important;
293 flex-grow: 1;
294 }
295 }
296 }