aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/sass/application.scss
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-03-31 11:21:10 +0200
committerChocobozzz <me@florianbigard.com>2021-03-31 11:21:10 +0200
commitd794137057fc5fcea10ddd29f82e79ee2412fea4 (patch)
treeda37f7efd604687c243cb2cd2cad6af932dcab8a /client/src/sass/application.scss
parent218f730c7bceda5511d46f26191e7b1726c9ffd3 (diff)
downloadPeerTube-d794137057fc5fcea10ddd29f82e79ee2412fea4.tar.gz
PeerTube-d794137057fc5fcea10ddd29f82e79ee2412fea4.tar.zst
PeerTube-d794137057fc5fcea10ddd29f82e79ee2412fea4.zip
Refactor horizontal margins
Diffstat (limited to 'client/src/sass/application.scss')
-rw-r--r--client/src/sass/application.scss161
1 files changed, 49 insertions, 112 deletions
diff --git a/client/src/sass/application.scss b/client/src/sass/application.scss
index 0cc394c8e..c35574568 100644
--- a/client/src/sass/application.scss
+++ b/client/src/sass/application.scss
@@ -57,7 +57,8 @@ body {
57 57
58 --activatedActionButtonColor: #{$activated-action-button-color}; 58 --activatedActionButtonColor: #{$activated-action-button-color};
59 59
60 --expanded-horizontal-margin-content: #{$expanded-horizontal-margins}; 60 --horizontalMarginContent: #{$not-expanded-horizontal-margins};
61 --mainColWidth: calc(100vw - #{$menu-width});
61 62
62 font-family: $main-fonts; 63 font-family: $main-fonts;
63 font-weight: $font-regular; 64 font-weight: $font-regular;
@@ -150,8 +151,8 @@ my-input-toggle-hidden ::ng-deep input {
150 outline: none; 151 outline: none;
151 152
152 .margin-content { 153 .margin-content {
153 margin-left: $not-expanded-horizontal-margins; 154 margin-left: pvar(--horizontalMarginContent);
154 margin-right: $not-expanded-horizontal-margins; 155 margin-right: pvar(--horizontalMarginContent);
155 flex-grow: 1; 156 flex-grow: 1;
156 } 157 }
157 158
@@ -160,14 +161,16 @@ my-input-toggle-hidden ::ng-deep input {
160 width: 100%; 161 width: 100%;
161 display: flex; 162 display: flex;
162 align-items: center; 163 align-items: center;
163 padding-left: $not-expanded-horizontal-margins; 164 padding-left: pvar(--horizontalMarginContent);
164 padding-right: $not-expanded-horizontal-margins; 165 padding-right: pvar(--horizontalMarginContent);
165 height: $sub-menu-height; 166 height: $sub-menu-height;
166 margin-bottom: $sub-menu-margin-bottom; 167 margin-bottom: $sub-menu-margin-bottom;
168 overflow-x: auto;
167 169
168 &.sub-menu-fixed { 170 &.sub-menu-fixed {
169 position: fixed; 171 position: fixed;
170 z-index: #{z('sub-menu') - 1}; 172 z-index: #{z('sub-menu') - 1};
173 max-width: pvar(--mainColWidth);
171 } 174 }
172 } 175 }
173 176
@@ -178,18 +181,11 @@ my-input-toggle-hidden ::ng-deep input {
178 181
179 // Override some properties if the main content is expanded (no menu on the left) 182 // Override some properties if the main content is expanded (no menu on the left)
180 &.expanded { 183 &.expanded {
184 --horizontalMarginContent: #{$expanded-horizontal-margins};
185 --mainColWidth: 100vw;
186
181 margin-left: 0; 187 margin-left: 0;
182 width: 100%; 188 width: 100%;
183
184 .margin-content {
185 margin-left: var(--expanded-horizontal-margin-content);
186 margin-right: var(--expanded-horizontal-margin-content);
187 }
188
189 .sub-menu {
190 padding-left: var(--expanded-horizontal-margin-content);
191 padding-right: var(--expanded-horizontal-margin-content);
192 }
193 } 189 }
194 190
195 &.lock-scroll .main-row > router-outlet + * { 191 &.lock-scroll .main-row > router-outlet + * {
@@ -336,30 +332,23 @@ ngx-loading-bar {
336} 332}
337 333
338@media screen and (max-width: #{breakpoint(xxl)}) { 334@media screen and (max-width: #{breakpoint(xxl)}) {
339 .main-col { 335 .main-col.expanded {
340 &.expanded { 336 --horizontalMarginContent: #{$expanded-horizontal-margins/2};
341 .margin-content {
342 --expanded-horizontal-margin-content: #{$expanded-horizontal-margins/2};
343 }
344 }
345 } 337 }
346} 338}
347 339
348@media screen and (max-width: #{breakpoint(lg)}) { 340@media screen and (max-width: #{breakpoint(lg)}) {
349 /* the following applies from 500px to 900px and is partially overriden from 500px to 800px by changes below to $small-view */ 341 /* the following applies from 500px to 900px and is partially overriden from 500px to 800px by changes below to $small-view */
350 .main-col { 342 .main-col,
351 &, &.expanded { 343 .main-col.expanded {
352 .margin-content { 344 --horizontalMarginContent: #{$expanded-horizontal-margins/3};
353 --expanded-horizontal-margin-content: #{$expanded-horizontal-margins/3};
354 }
355 345
356 .sub-menu { 346 .sub-menu {
357 padding-left: 50px; 347 padding-left: 50px;
358 padding-right: 50px; 348 padding-right: 50px;
359 349
360 .title-page { 350 .title-page {
361 font-size: 17px; 351 font-size: 17px;
362 }
363 } 352 }
364 } 353 }
365 } 354 }
@@ -372,98 +361,46 @@ ngx-loading-bar {
372} 361}
373 362
374@media screen and (max-width: $small-view) { 363@media screen and (max-width: $small-view) {
375 .main-col { 364 .main-col,
376 margin-left: 0; 365 .main-col.expanded {
377 366 --horizontalMarginContent: 15px;
378 &, &.expanded {
379 .margin-content {
380 --expanded-horizontal-margin-content: 15px;
381 }
382
383 .sub-menu {
384 width: 100vw;
385 padding-left: 15px;
386 padding-right: 15px;
387 margin-bottom: $sub-menu-margin-bottom-small-view;
388 overflow-x: auto;
389 }
390
391 // Use an appropriate offset top when sub-menu fixed
392 .margin-content.offset-content {
393 padding-top: $sub-menu-height + $sub-menu-margin-bottom-small-view;
394 }
395
396 .admin-sub-header {
397 @include admin-sub-header-responsive(15px*2);
398 }
399
400 my-markdown-textarea {
401 .root {
402 max-width: 100% !important;
403 }
404 }
405 367
406 input[type=text], 368 margin-left: 0;
407 input[type=password],
408 input[type=email],
409 textarea,
410 .peertube-select-container {
411 flex-grow: 1;
412 }
413
414 .caption input[type=text] {
415 width: unset !important;
416 flex-grow: 1;
417 }
418 }
419 }
420}
421 369
422// overflow-databale responsive rules 370 .sub-menu {
423@media screen and (min-width: #{breakpoint(lg)}) { 371 width: 100vw;
424 .main-col { 372 padding-left: 15px;
425 &.expanded { 373 padding-right: 15px;
426 @include overflow-datatable(breakpoint(lg), $expanded-horizontal-margins/2, $mobile-paginator: false); 374 margin-bottom: $sub-menu-margin-bottom-small-view;
375 overflow-x: auto;
427 } 376 }
428 377
429 &:not(.expanded) { 378 // Use an appropriate offset top when sub-menu fixed
430 @include overflow-datatable(breakpoint(lg), $not-expanded-horizontal-margins + $menu-width/2, $mobile-paginator: false); 379 .margin-content.offset-content {
380 padding-top: $sub-menu-height + $sub-menu-margin-bottom-small-view;
431 } 381 }
432 }
433}
434 382
435@media screen and (max-width: #{breakpoint(lg)}) { 383 .admin-sub-header {
436 .main-col { 384 @include admin-sub-header-responsive;
437 &.expanded {
438 @include overflow-datatable(breakpoint(lg), $expanded-horizontal-margins/3);
439 } 385 }
440 386
441 &:not(.expanded) { 387 my-markdown-textarea {
442 @include overflow-datatable(breakpoint(lg), $expanded-horizontal-margins/3 + $menu-width/2); 388 .root {
389 max-width: 100% !important;
390 }
443 } 391 }
444 }
445}
446 392
447@media screen and (max-width: $small-view) { 393 input[type=text],
448 .main-col { 394 input[type=password],
449 &:not(.expanded), 395 input[type=email],
450 &.expanded { 396 textarea,
451 @include overflow-datatable(breakpoint(lg), 15px); 397 .peertube-select-container {
398 flex-grow: 1;
452 } 399 }
453 }
454}
455
456@media screen and (min-width: $small-view) and (max-width: #{$small-view + $menu-width}) {
457 .main-col {
458 &:not(.expanded) {
459 .admin-sub-header {
460 @include admin-sub-header-responsive($expanded-horizontal-margins/3 + $menu-width/2);
461 }
462 400
463 .sub-menu { 401 .caption input[type=text] {
464 overflow-x: auto; 402 width: unset !important;
465 width: calc(100vw - #{$menu-width}); 403 flex-grow: 1;
466 }
467 } 404 }
468 } 405 }
469} 406}