aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/sass
diff options
context:
space:
mode:
authorWicklow <wicklow@framasoft.org>2023-02-20 11:32:48 +0100
committerChocobozzz <chocobozzz@cpy.re>2023-02-20 13:52:22 +0100
commit4158e67c8d7eb39712e598d3f409c6739eef5f0b (patch)
treed80a3b09af7bb83ce4eb2783dad449a9bfe87bd2 /client/src/sass
parent6c3589fc51fdf218912538b2a46399886ed36ac3 (diff)
downloadPeerTube-4158e67c8d7eb39712e598d3f409c6739eef5f0b.tar.gz
PeerTube-4158e67c8d7eb39712e598d3f409c6739eef5f0b.tar.zst
PeerTube-4158e67c8d7eb39712e598d3f409c6739eef5f0b.zip
Refactoring margin and padding mixins
Diffstat (limited to 'client/src/sass')
-rw-r--r--client/src/sass/class-helpers/_custom-bootstrap-helpers.scss2
-rw-r--r--client/src/sass/include/_account-channel-page.scss2
-rw-r--r--client/src/sass/include/_mixins.scss41
-rw-r--r--client/src/sass/include/_variables.scss3
4 files changed, 35 insertions, 13 deletions
diff --git a/client/src/sass/class-helpers/_custom-bootstrap-helpers.scss b/client/src/sass/class-helpers/_custom-bootstrap-helpers.scss
index bb5902ec9..dfe6f9050 100644
--- a/client/src/sass/class-helpers/_custom-bootstrap-helpers.scss
+++ b/client/src/sass/class-helpers/_custom-bootstrap-helpers.scss
@@ -4,5 +4,5 @@
4// Font sizes 4// Font sizes
5 5
6.fs-5-5 { 6.fs-5-5 {
7 @include font-size(1.125rem); 7 @include font-size(18px);
8} 8}
diff --git a/client/src/sass/include/_account-channel-page.scss b/client/src/sass/include/_account-channel-page.scss
index ab6c772c1..c47acb7b7 100644
--- a/client/src/sass/include/_account-channel-page.scss
+++ b/client/src/sass/include/_account-channel-page.scss
@@ -16,7 +16,7 @@
16} 16}
17 17
18@mixin show-more-description { 18@mixin show-more-description {
19 @include rfs(10px auto 45px, margin); 19 @include margin(10px, auto, 45px);
20 20
21 color: pvar(--mainColor); 21 color: pvar(--mainColor);
22 cursor: pointer; 22 cursor: pointer;
diff --git a/client/src/sass/include/_mixins.scss b/client/src/sass/include/_mixins.scss
index bd467a0ed..3941cf374 100644
--- a/client/src/sass/include/_mixins.scss
+++ b/client/src/sass/include/_mixins.scss
@@ -919,20 +919,25 @@
919 } 919 }
920} 920}
921 921
922@mixin margin ($block-start, $inline-end, $block-end, $inline-start) { 922@mixin margin ($arg1: null, $arg2: null, $arg3: null, $arg4: null) {
923 @if $arg2 ==null and $arg3 ==null and $arg4 ==null {
924 @include margin-original($arg1, $arg1, $arg1, $arg1);
925 } @else if $arg3 ==null and $arg4 ==null {
926 @include margin-original($arg1, $arg2, $arg1, $arg2);
927 } @else if $arg4 ==null {
928 @include margin-original($arg1, $arg2, $arg3, $arg2);
929 } @else {
930 @include margin-original($arg1, $arg2, $arg3, $arg4);
931 }
932}
933
934@mixin margin-original ($block-start, $inline-end, $block-end, $inline-start) {
923 @include margin-left($inline-start); 935 @include margin-left($inline-start);
924 @include margin-right($inline-end); 936 @include margin-right($inline-end);
925 @include margin-top($block-start); 937 @include margin-top($block-start);
926 @include margin-bottom($block-end); 938 @include margin-bottom($block-end);
927} 939}
928 940
929@mixin padding ($block-start, $inline-end, $block-end, $inline-start) {
930 @include padding-left($inline-start);
931 @include padding-right($inline-end);
932 @include padding-top($block-start);
933 @include padding-bottom($block-end);
934}
935
936@mixin margin-left ($value) { 941@mixin margin-left ($value) {
937 @supports (margin-inline-start: $value) { 942 @supports (margin-inline-start: $value) {
938 @include rfs($value, margin-inline-start); 943 @include rfs($value, margin-inline-start);
@@ -953,6 +958,26 @@
953 } 958 }
954} 959}
955 960
961@mixin padding-original ($block-start, $inline-end, $block-end, $inline-start) {
962 @include padding-left($inline-start);
963 @include padding-right($inline-end);
964 @include padding-top($block-start);
965 @include padding-bottom($block-end);
966}
967
968
969@mixin padding ($arg1: null, $arg2: null, $arg3: null, $arg4: null) {
970 @if $arg2 ==null and $arg3 ==null and $arg4 ==null {
971 @include padding-original($arg1, $arg1, $arg1, $arg1);
972 } @else if $arg3 ==null and $arg4 ==null {
973 @include padding-original($arg1, $arg2, $arg1, $arg2);
974 } @else if $arg4 ==null {
975 @include padding-original($arg1, $arg2, $arg3, $arg2);
976 } @else {
977 @include padding-original($arg1, $arg2, $arg3, $arg4);
978 }
979}
980
956@mixin padding-left ($value) { 981@mixin padding-left ($value) {
957 @supports (padding-inline-start: $value) { 982 @supports (padding-inline-start: $value) {
958 @include rfs($value, padding-inline-start); 983 @include rfs($value, padding-inline-start);
diff --git a/client/src/sass/include/_variables.scss b/client/src/sass/include/_variables.scss
index 1243854ec..8358270da 100644
--- a/client/src/sass/include/_variables.scss
+++ b/client/src/sass/include/_variables.scss
@@ -10,9 +10,6 @@ $font-semibold: 600;
10$font-bold: 700; 10$font-bold: 700;
11$line-height-normal: 1.2; 11$line-height-normal: 1.2;
12 12
13$font-size-rem-13px: 0.8125rem;
14$font-size-rem-14px: 0.875rem;
15
16$grey-background-color: #E5E5E5; 13$grey-background-color: #E5E5E5;
17$grey-background-hover-color: #EFEFEF; 14$grey-background-hover-color: #EFEFEF;
18$grey-foreground-color: #585858; 15$grey-foreground-color: #585858;