Browse Source

feat: implement reusable button component

pull/15/head
Tyler Chen 4 years ago
parent
commit
80cb4ed1a9
4 changed files with 72 additions and 0 deletions
  1. +64
    -0
      src/_components/shared/Button.vue
  2. +1
    -0
      src/_components/shared/index.js
  3. +3
    -0
      src/_scss/_base.scss
  4. +4
    -0
      src/_scss/_variables.scss

+ 64
- 0
src/_components/shared/Button.vue View File

@@ -0,0 +1,64 @@
<template>
<button
v-bind="$attrs"
@click="click($event)"
:class="{ round: round, block: block }"
class="app-btn"
>
<slot></slot>
</button>
</template>

<style lang="scss" scoped>
@import '../../_scss/_variables';

.app-btn {
font-size: 14px;
box-shadow: 0px 0px 0px 0px rgba(0, 0, 0, 0);
transition: all 300ms ease 0ms;

max-height: 100%;
height: 60px;

&:hover {
box-shadow: 0px 10px 30px 0px rgba(177, 66, 236, 0.33);
}

&.round {
border-radius: 50px;
}

&.block {
display: block;
}

// TODP: color schemas
}
</style>

<script>
export default {
props: {
round: {
type: Boolean,
default: true,
},
block: {
type: Boolean,
default: false,
},
color: {
type: String,
default: '',
},
},
data() {
return {};
},
methods: {
click(event) {
this.$emit('click', event);
},
},
};
</script>

+ 1
- 0
src/_components/shared/index.js View File

@@ -0,0 +1 @@
export { default as Button } from './Button';

+ 3
- 0
src/_scss/_base.scss View File

@@ -0,0 +1,3 @@
html, body {
font-family: 'Luto';
}

src/_scss/variables.scss → src/_scss/_variables.scss View File

@@ -71,3 +71,7 @@ $bright-cyan-7: #abedd9;
$bright-cyan-8: #bcf1e1;
$bright-cyan-9: #cdf4e8;
$bright-cyan-10: #def8f0;


// fonts
$default-font-family: 'Lato';

Loading…
Cancel
Save