From e0c5be10aae81b60984277d68cf342f97f90cedc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Fri, 13 Oct 2023 11:40:16 +0200 Subject: [PATCH] Extract mixins to style separators This way they can be reused in other places. --- app/assets/stylesheets/mixins/separators.scss | 23 +++++++++++++++++++ .../stylesheets/moderation_actions.scss | 20 ++-------------- 2 files changed, 25 insertions(+), 18 deletions(-) create mode 100644 app/assets/stylesheets/mixins/separators.scss diff --git a/app/assets/stylesheets/mixins/separators.scss b/app/assets/stylesheets/mixins/separators.scss new file mode 100644 index 000000000..f5bdfc606 --- /dev/null +++ b/app/assets/stylesheets/mixins/separators.scss @@ -0,0 +1,23 @@ +@mixin separator { + content: ""; + display: inline-block; + margin: 0 0.3em; + vertical-align: middle; +} + +@mixin vertical-separator { + @include separator; + background: currentcolor; + height: 1em; + opacity: 0.5; + width: 1px; +} + +@mixin circle-separator { + @include separator; + background: $text-light; + border-radius: 100%; + height: 0.25em; + opacity: 1; + width: 0.25em; +} diff --git a/app/assets/stylesheets/moderation_actions.scss b/app/assets/stylesheets/moderation_actions.scss index f3a00d662..dc77c9144 100644 --- a/app/assets/stylesheets/moderation_actions.scss +++ b/app/assets/stylesheets/moderation_actions.scss @@ -8,29 +8,13 @@ @include link; } - @mixin separator { - content: ""; - display: inline-block; - margin: 0 0.3em; - vertical-align: middle; - } - > * + *::before { - @include separator; - background: currentcolor; - height: 1em; - opacity: 0.5; - width: 1px; + @include vertical-separator; } .comment & { > *::before { - @include separator; - background: $text-light; - border-radius: 100%; - opacity: 1; - height: 0.25em; - width: 0.25em; + @include circle-separator; } } }