forked from area17/twill
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWysiwygMenuBarButton.vue
70 lines (64 loc) · 1.24 KB
/
WysiwygMenuBarButton.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<template>
<button class="wysiwyg__menubar-button"
:class="{ 'is-active': isActive }"
type="button"
@click="handleClick">
<span class="icon"
:class="`icon--wysiwyg_${icon}`"
aria-hidden="true">
<svg>
<title>{{ icon }}</title>
<use :xlink:href="`#icon--wysiwyg_${icon}`"></use>
</svg>
</span>
</button>
</template>
<script>
export default {
name: 'WysiwygMenuBarButton',
props: {
icon: {
type: String,
required: true
},
isActive: {
type: Boolean,
default: false
}
},
methods: {
handleClick () {
this.$emit('btn:click')
}
}
}
</script>
<style lang="scss" scoped>
@import '~styles/setup/icons-wysiwyg';
.wysiwyg__menubar-button {
width: 24px;
margin-right: 10px;
margin-top: 5px;
margin-bottom: 5px;
font-size: 1em;
border: 0 none;
outline: none;
cursor: pointer;
text-align: center;
background-color: transparent;
-webkit-appearance: none;
&:hover,
&:focus,
&.is-active {
color: $color__link;
}
}
.icon {
width: 15px;
height: 15px;
svg {
width: 15px;
height: 15px;
}
}
</style>