refactor: move button styles in separate mixin
This commit is contained in:
parent
087c8af8bf
commit
25e8b0ad65
3 changed files with 27 additions and 24 deletions
|
@ -21,6 +21,7 @@ export default {
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@import "@/scss/_variables.scss";
|
@import "@/scss/_variables.scss";
|
||||||
|
@import "@/scss/_mixins.scss";
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
margin: 0.5em 0;
|
margin: 0.5em 0;
|
||||||
|
@ -30,7 +31,6 @@ export default {
|
||||||
top: 0;
|
top: 0;
|
||||||
|
|
||||||
border-radius: 0.25em;
|
border-radius: 0.25em;
|
||||||
box-shadow: 0 0.5em 0 0 darken($bg-color-dark, 10%);
|
|
||||||
|
|
||||||
transition: all 0.1s ease-out;
|
transition: all 0.1s ease-out;
|
||||||
|
|
||||||
|
@ -40,14 +40,14 @@ export default {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
|
@include button($bg-color-dark);
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
top: -0.25em;
|
top: -0.25em;
|
||||||
box-shadow: 0 0.75em 0 0 darken($bg-color-dark, 10%);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&:active {
|
&:active {
|
||||||
top: 0.25em;
|
top: 0.25em;
|
||||||
box-shadow: 0 0.25em 0 0 darken($bg-color-dark, 10%);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -30,6 +30,7 @@ export default {
|
||||||
this.$root.nsfw = input;
|
this.$root.nsfw = input;
|
||||||
this.$root.isConfirmedHorny = input;
|
this.$root.isConfirmedHorny = input;
|
||||||
this.$root.isWarn = false;
|
this.$root.isWarn = false;
|
||||||
|
document.body.classList.toggle("scroll-lock");
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -57,6 +58,7 @@ export default {
|
||||||
|
|
||||||
padding: 2em;
|
padding: 2em;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
overflow: auto;
|
||||||
|
|
||||||
&__background {
|
&__background {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
@ -101,29 +103,11 @@ export default {
|
||||||
margin: 0.75em 0;
|
margin: 0.75em 0;
|
||||||
|
|
||||||
&.positive {
|
&.positive {
|
||||||
box-shadow: 0 0.5em 0 0 darken($btn-color-positive, 10%);
|
@include button($btn-color-positive);
|
||||||
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%);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&.negative {
|
&.negative {
|
||||||
box-shadow: 0 0.5em 0 0 darken($btn-color-negative, 10%);
|
@include button($btn-color-negative);
|
||||||
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%);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -1,5 +1,11 @@
|
||||||
|
@mixin mq-bigscreen() {
|
||||||
|
@media (min-width: 125em) {
|
||||||
|
@content
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
@mixin mq-desktop() {
|
@mixin mq-desktop() {
|
||||||
@media (min-width: 60em) {
|
@media (min-width: 50em) {
|
||||||
@content
|
@content
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -9,3 +15,16 @@
|
||||||
@content
|
@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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue