diff --git a/js/src/App.vue b/js/src/App.vue
index 237ab57d9..cafe7ffe1 100644
--- a/js/src/App.vue
+++ b/js/src/App.vue
@@ -246,7 +246,6 @@ export default class App extends Vue {
/* Icons */
$mdi-font-path: "~@mdi/font/fonts";
@import "~@mdi/font/scss/materialdesignicons";
-
@import "common";
#mobilizon {
diff --git a/js/src/common.scss b/js/src/common.scss
index b9c39647d..9566e8925 100644
--- a/js/src/common.scss
+++ b/js/src/common.scss
@@ -1,3 +1,4 @@
+@use "@/styles/_mixins" as *;
@import "variables.scss";
@import "~bulma";
@@ -39,7 +40,7 @@ $color-black: #000;
border-radius: 5px;
padding: 0.2rem;
white-space: nowrap;
- margin-right: 0.2rem;
+ @include margin-right(0.2rem);
}
.mention-suggestion {
@@ -48,7 +49,7 @@ $color-black: #000;
.mention .mention {
background: initial;
- margin-right: 0;
+ @include margin-right(0);
}
.select select {
diff --git a/js/src/components/Account/ActorCard.vue b/js/src/components/Account/ActorCard.vue
index a57c2692a..2b7018e88 100644
--- a/js/src/components/Account/ActorCard.vue
+++ b/js/src/components/Account/ActorCard.vue
@@ -53,6 +53,7 @@ export default class ActorCard extends Vue {
diff --git a/js/src/components/Comment/Comment.vue b/js/src/components/Comment/Comment.vue
index 33fd0cc92..5ca556ea7 100644
--- a/js/src/components/Comment/Comment.vue
+++ b/js/src/components/Comment/Comment.vue
@@ -336,6 +336,7 @@ export default class Comment extends Vue {
}
diff --git a/js/src/components/Event/EventMinimalistCard.vue b/js/src/components/Event/EventMinimalistCard.vue
index 631c286ae..09443f91f 100644
--- a/js/src/components/Event/EventMinimalistCard.vue
+++ b/js/src/components/Event/EventMinimalistCard.vue
@@ -131,6 +131,7 @@ export default class EventMinimalistCard extends Vue {
}
diff --git a/js/src/styles/_event-card.scss b/js/src/styles/_event-card.scss
index f657bc47d..4854de21b 100644
--- a/js/src/styles/_event-card.scss
+++ b/js/src/styles/_event-card.scss
@@ -1,9 +1,11 @@
+@use "@/styles/_mixins" as *;
+
.event-organizer {
display: flex;
align-items: center;
.organizer-name {
- padding-left: 5px;
+ @include padding-left(5px);
font-weight: 600;
}
}
@@ -13,6 +15,6 @@
align-items: center;
& > span:not(.icon) {
- padding-left: 5px;
+ @include padding-left(5px);
}
}
diff --git a/js/src/styles/_mixins.scss b/js/src/styles/_mixins.scss
new file mode 100644
index 000000000..040d3ae82
--- /dev/null
+++ b/js/src/styles/_mixins.scss
@@ -0,0 +1,55 @@
+@mixin margin($block-start, $inline-end, $block-end, $inline-start) {
+ @include margin-left($inline-start);
+ @include margin-right($inline-end);
+
+ margin-top: $block-start;
+ margin-bottom: $block-end;
+}
+
+@mixin padding($block-start, $inline-end, $block-end, $inline-start) {
+ @include padding-left($inline-start);
+ @include padding-right($inline-end);
+
+ padding-top: $block-start;
+ padding-bottom: $block-end;
+}
+
+@mixin margin-left($value) {
+ @supports (margin-inline-start: $value) {
+ margin-inline-start: $value;
+ }
+
+ @supports not (margin-inline-start: $value) {
+ margin-left: $value;
+ }
+}
+
+@mixin margin-right($value) {
+ @supports (margin-inline-end: $value) {
+ margin-inline-end: $value;
+ }
+
+ @supports not (margin-inline-end: $value) {
+ margin-right: $value;
+ }
+}
+
+@mixin padding-left($value) {
+ @supports (padding-inline-start: $value) {
+ padding-inline-start: $value;
+ }
+
+ @supports not (padding-inline-start: $value) {
+ padding-left: $value;
+ }
+}
+
+@mixin padding-right($value) {
+ @supports (padding-inline-end: $value) {
+ padding-inline-end: $value;
+ }
+
+ @supports not (padding-inline-end: $value) {
+ padding-right: $value;
+ }
+}
diff --git a/js/src/views/Account/children/EditIdentity.vue b/js/src/views/Account/children/EditIdentity.vue
index 5d4e5f5e7..5395cdb49 100644
--- a/js/src/views/Account/children/EditIdentity.vue
+++ b/js/src/views/Account/children/EditIdentity.vue
@@ -215,7 +215,7 @@ h1 {
}
::v-deep .buttons > *:not(:last-child) .button {
- margin-right: 0.5rem;
+ @include margin-right(0.5rem);
}
diff --git a/js/src/views/Discussions/Discussion.vue b/js/src/views/Discussions/Discussion.vue
index a016318d1..20fe5f6a9 100644
--- a/js/src/views/Discussions/Discussion.vue
+++ b/js/src/views/Discussions/Discussion.vue
@@ -496,6 +496,7 @@ export default class Discussion extends mixins(GroupMixin) {
}