-
Notifications
You must be signed in to change notification settings - Fork 145
Expand file tree
/
Copy pathAlignmentButtons.vue
More file actions
68 lines (59 loc) · 1.62 KB
/
AlignmentButtons.vue
File metadata and controls
68 lines (59 loc) · 1.62 KB
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
<script setup>
import { useHighContrastMode } from '../../composables/use-high-contrast-mode';
import { toolbarIcons } from './toolbarIcons.js';
const { isHighContrastMode } = useHighContrastMode();
const emit = defineEmits(['select']);
const select = (alignment) => {
emit('select', alignment);
};
</script>
<template>
<div class="alignment-buttons" :class="{ 'high-contrast': isHighContrastMode }">
<div class="button-icon" @click="select('left')" v-html="toolbarIcons.alignLeft" data-item="btn-textAlign-option">
</div>
<div class="button-icon" @click="select('center')" v-html="toolbarIcons.alignCenter"
data-item="btn-textAlign-option"></div>
<div class="button-icon" @click="select('right')" v-html="toolbarIcons.alignRight" data-item="btn-textAlign-option">
</div>
<div class="button-icon" @click="select('justify')" v-html="toolbarIcons.alignJustify"
data-item="btn-textAlign-option"></div>
</div>
</template>
<style scoped>
.alignment-buttons {
display: flex;
justify-content: space-between;
width: 100%;
padding: 8px;
box-sizing: border-box;
.button-icon {
cursor: pointer;
padding: 5px;
font-size: 16px;
width: 25px;
height: 25px;
border-radius: 4px;
display: flex;
justify-content: center;
align-items: center;
box-sizing: border-box;
&:hover {
background-color: #d8dee5;
}
:deep(svg) {
width: 100%;
height: 100%;
display: block;
fill: currentColor;
}
}
&.high-contrast {
.button-icon {
&:hover {
background-color: #000;
color: #fff;
}
}
}
}
</style>