Improving the button style
This commit is contained in:
parent
49c153ee38
commit
f3e7b18c34
@ -1,3 +1,77 @@
|
|||||||
@mixin btn($revese: false) {
|
@import "colors";
|
||||||
|
|
||||||
|
$default-color: transparent !default;
|
||||||
|
$dark-gray: #4f4f4f !default;
|
||||||
|
$navy-blue: #436da7 !default;
|
||||||
|
$white: white !default;
|
||||||
|
|
||||||
|
$btn-colors: (
|
||||||
|
border: $dark-gray,
|
||||||
|
bg: $default-color,
|
||||||
|
font: $dark-gray,
|
||||||
|
hover: (
|
||||||
|
bg: $dark-gray,
|
||||||
|
font: $white
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
display: block;
|
||||||
|
min-width: 270px;
|
||||||
|
padding: 8px 10px;
|
||||||
|
|
||||||
|
border-radius: 3px;
|
||||||
|
border-width: 3px;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: $default-color;
|
||||||
|
|
||||||
|
background-color: map-get($btn-colors, bg);
|
||||||
|
}
|
||||||
|
|
||||||
|
@mixin btn($colors: $btn-colors) {
|
||||||
|
border-color: map-get($colors, border);
|
||||||
|
background-color: map-get($colors, bg);
|
||||||
|
|
||||||
|
font-size: 1.05em;
|
||||||
|
color: map-get($colors, font);
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
$hovers: map-get($colors, hover);
|
||||||
|
background-color: map-get($hovers, bg);
|
||||||
|
color: map-get($hovers, font);
|
||||||
|
}
|
||||||
|
|
||||||
|
@content;
|
||||||
|
}
|
||||||
|
|
||||||
|
@mixin btn-reverse($leading-color: $dark-gray) {
|
||||||
|
$colors: (
|
||||||
|
border: $leading-color,
|
||||||
|
bg: $leading-color,
|
||||||
|
font: $white,
|
||||||
|
hover: (
|
||||||
|
bg: $default-color,
|
||||||
|
font: $leading-color
|
||||||
|
)
|
||||||
|
);
|
||||||
|
@include btn($colors);
|
||||||
|
}
|
||||||
|
|
||||||
|
@mixin button($reverse: false, $has-icon: false) {
|
||||||
|
@if not $reverse {
|
||||||
|
@include btn()
|
||||||
|
} @else {
|
||||||
|
@include btn-reverse($navy-blue);
|
||||||
|
}
|
||||||
|
@if $has-icon {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
margin-right: 10px;
|
||||||
|
font-size: 1.3em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@content;
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
// default colors
|
// default colors
|
||||||
$gray: #fafafa;
|
$gray: #fafafa;
|
||||||
$dark-gray: #4f4f4f;
|
$dark-gray: #4f4f4f;
|
||||||
|
$navy-blue: #436da7 !default;
|
||||||
|
|
||||||
// default colors for style
|
// default colors for style
|
||||||
$text-color: #2c3e50;
|
$text-color: #2c3e50;
|
||||||
$bg-color: white;
|
$bg-color: white;
|
||||||
|
|
||||||
|
$white: white;
|
||||||
|
@ -4,21 +4,26 @@
|
|||||||
a {
|
a {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
h2 {
|
h2 {
|
||||||
font-size: 1.8em;
|
font-size: 1.8em;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
p {
|
p {
|
||||||
font-size: 1.1em;
|
font-size: 1.1em;
|
||||||
line-height: 1.4em;
|
line-height: 1.4em;
|
||||||
|
|
||||||
&:not(&:last-of-type) {
|
&:not(&:last-of-type) {
|
||||||
padding-bottom: 10px;
|
padding-bottom: 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.container {
|
.container {
|
||||||
max-width: 1200px;
|
max-width: 1200px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.loading {
|
.loading {
|
||||||
height: 300px;
|
height: 300px;
|
||||||
|
|
||||||
@ -32,6 +37,7 @@ p {
|
|||||||
animation: loading-animation 1s linear infinite;
|
animation: loading-animation 1s linear infinite;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 1200px) {
|
@media screen and (max-width: 1200px) {
|
||||||
.container {
|
.container {
|
||||||
padding: 0 20px;
|
padding: 0 20px;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<button class="btn" :class="{ reverse: isReverse }">
|
<button class="btn" :class="{ 'btn-reverse': isReverse }">
|
||||||
<font-awesome-icon class="icon" v-if="hasIcon" :icon="icon"/>
|
<font-awesome-icon class="icon" v-if="hasIcon" :icon="icon"/>
|
||||||
<span><slot></slot></span>
|
<span><slot></slot></span>
|
||||||
</button>
|
</button>
|
||||||
@ -17,40 +17,13 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
$btn-blue-color: #436DA7;
|
@import "scss/_btn";
|
||||||
$btn-gray-color: #4f4f4f;
|
|
||||||
$hover-btn-color: white;
|
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
display: flex;
|
@include button($has-icon: true);
|
||||||
min-width: 270px;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
padding: 8px 10px;
|
|
||||||
border: 3px solid $btn-gray-color;
|
|
||||||
background-color: transparent;
|
|
||||||
color: $btn-gray-color;
|
|
||||||
border-radius: 3px;
|
|
||||||
font-size: 1.05em;
|
|
||||||
|
|
||||||
.icon {
|
|
||||||
margin-right: 10px;
|
|
||||||
font-size: 1.3em;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
background-color: $btn-gray-color;
|
|
||||||
color: $hover-btn-color;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
.reverse {
|
|
||||||
background-color: $btn-blue-color;
|
|
||||||
border-color: $btn-blue-color;
|
|
||||||
color: $hover-btn-color;
|
|
||||||
|
|
||||||
&:hover {
|
.btn-reverse {
|
||||||
background-color: transparent;
|
@include button(true, true);
|
||||||
color: $btn-blue-color;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user