Added support for icons in button
This commit is contained in:
parent
962da10552
commit
32445d7f25
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<button class="btn" :class="isReverse ? 'reverse' : ''">
|
||||
<i v-if="hasIcon" :class="classIcon"></i>
|
||||
<slot></slot>
|
||||
<font-awesome-icon class="icon" if="hasIcon" :icon="icon"/>
|
||||
<span><slot></slot></span>
|
||||
</button>
|
||||
</template>
|
||||
|
||||
@ -10,7 +10,7 @@ export default {
|
||||
name: 'BaseButton',
|
||||
props: {
|
||||
hasIcon: Boolean,
|
||||
classIcon: String,
|
||||
icon: String,
|
||||
isReverse: Boolean
|
||||
}
|
||||
}
|
||||
@ -21,11 +21,19 @@ $btn-color: black;
|
||||
$hover-btn-color: white;
|
||||
|
||||
.btn {
|
||||
padding: 10px 15px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 8px 10px;
|
||||
border: 1px solid #{$btn-color};
|
||||
background-color: transparent;
|
||||
color: $btn-color;
|
||||
border-radius: 0;
|
||||
|
||||
.icon {
|
||||
margin-right: 5px;
|
||||
font-size: 1.5em;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background-color: $btn-color;
|
||||
color: $hover-btn-color;
|
||||
|
@ -6,7 +6,9 @@
|
||||
<h2 class="name">Kamil Niemczycki</h2>
|
||||
<div class="tagline">Web Developer</div>
|
||||
<p>I'm a software engineer specialised in frontend and backend development for complex scalable web apps. I write about software development on my blog. Want to know how I may help your project? Check out my project portfolio and online resume.</p>
|
||||
<base-btn class-icon="my-class" has-icon>Wyświetl portfolio</base-btn>
|
||||
<div class="buttons">
|
||||
<base-btn has-icon icon="portrait">Wyświetl portfolio</base-btn>
|
||||
</div>
|
||||
</div>
|
||||
<div id="grid-photo">
|
||||
<figure id="about-photo">
|
||||
@ -19,11 +21,6 @@
|
||||
</template>
|
||||
|
||||
<style lang="scss">
|
||||
.btn {
|
||||
i.my-class:before {
|
||||
content: 'XD ';
|
||||
}
|
||||
}
|
||||
div.about {
|
||||
padding: 20px 0;
|
||||
background-color: var(--gray-color) !important;
|
||||
|
Loading…
x
Reference in New Issue
Block a user