From 25e8b0ad65edbecba65159ed87ad7b112205119c Mon Sep 17 00:00:00 2001 From: Sebin Nyshkim Date: Tue, 11 Jan 2022 20:29:42 +0100 Subject: [PATCH] refactor: move button styles in separate mixin --- src/components/Button.vue | 6 +++--- src/components/NsfwWarning.vue | 24 ++++-------------------- src/scss/_mixins.scss | 21 ++++++++++++++++++++- 3 files changed, 27 insertions(+), 24 deletions(-) diff --git a/src/components/Button.vue b/src/components/Button.vue index 3dfe116..e3692d0 100644 --- a/src/components/Button.vue +++ b/src/components/Button.vue @@ -21,6 +21,7 @@ export default { diff --git a/src/components/NsfwWarning.vue b/src/components/NsfwWarning.vue index 9c0003e..e74ff99 100644 --- a/src/components/NsfwWarning.vue +++ b/src/components/NsfwWarning.vue @@ -30,6 +30,7 @@ export default { this.$root.nsfw = input; this.$root.isConfirmedHorny = input; this.$root.isWarn = false; + document.body.classList.toggle("scroll-lock"); }, }, }; @@ -57,6 +58,7 @@ export default { padding: 2em; text-align: center; + overflow: auto; &__background { position: absolute; @@ -101,29 +103,11 @@ export default { margin: 0.75em 0; &.positive { - box-shadow: 0 0.5em 0 0 darken($btn-color-positive, 10%); - background-color: $btn-color-positive; - - &:hover { - box-shadow: 0 0.75em 0 0 darken($btn-color-positive, 10%); - } - - &:active { - box-shadow: 0 0.25em 0 0 darken($btn-color-positive, 10%); - } + @include button($btn-color-positive); } &.negative { - box-shadow: 0 0.5em 0 0 darken($btn-color-negative, 10%); - background-color: $btn-color-negative; - - &:hover { - box-shadow: 0 0.75em 0 0 darken($btn-color-negative, 10%); - } - - &:active { - box-shadow: 0 0.25em 0 0 darken($btn-color-negative, 10%); - } + @include button($btn-color-negative); } } diff --git a/src/scss/_mixins.scss b/src/scss/_mixins.scss index c3d9ff4..fe9750a 100644 --- a/src/scss/_mixins.scss +++ b/src/scss/_mixins.scss @@ -1,5 +1,11 @@ +@mixin mq-bigscreen() { + @media (min-width: 125em) { + @content + } +}; + @mixin mq-desktop() { - @media (min-width: 60em) { + @media (min-width: 50em) { @content } }; @@ -9,3 +15,16 @@ @content } }; + +@mixin button($btn-color, $darken: 10%) { + box-shadow: 0 0.5em 0 0 darken($btn-color, $darken); + background-color: $btn-color; + + &:hover { + box-shadow: 0 0.75em 0 0 darken($btn-color, $darken); + } + + &:active { + box-shadow: 0 0.25em 0 0 darken($btn-color, $darken); + } +}