api-client/components/settings/swatch.vue

60 lines
963 B
Vue
Raw Normal View History

<template>
<div
class="color"
:data-color="color"
:class="{ active: active }"
v-tooltip="{ content: name || color }"
2020-02-11 03:21:34 +00:00
:style="{ backgroundColor: color }"
>
2020-02-11 03:21:34 +00:00
<i v-if="active" class="material-icons activeTick">done</i>
2019-09-17 09:55:32 +00:00
</div>
</template>
2019-12-06 01:41:38 +00:00
<style scoped lang="scss">
2019-11-02 05:32:21 +00:00
.color {
display: inline-flex;
align-items: center;
justify-content: center;
2019-12-01 00:50:37 +00:00
margin: 8px;
2020-02-11 03:21:34 +00:00
padding: 16px;
2019-12-01 00:50:37 +00:00
border-radius: 100%;
border: 3px solid var(--bg-dark-color);
2019-11-02 05:32:21 +00:00
cursor: pointer;
transition: all 0.2s ease-in-out;
2019-12-01 00:50:37 +00:00
&.fg {
color: var(--act-color);
}
2019-11-02 05:32:21 +00:00
&.active {
2019-12-01 00:50:37 +00:00
border: 3px solid var(--ac-color);
}
&.fg.active {
border: 3px solid var(--fg-color);
2019-11-02 05:32:21 +00:00
}
2020-02-11 03:21:34 +00:00
.activeTick {
position: absolute;
2019-09-17 09:55:32 +00:00
}
2019-11-02 05:32:21 +00:00
}
</style>
<script>
2019-11-02 05:32:21 +00:00
export default {
props: {
color: {
type: String,
2020-02-24 18:44:50 +00:00
required: true,
2019-11-02 05:32:21 +00:00
},
name: {
2020-02-24 18:44:50 +00:00
type: String,
2019-11-02 05:32:21 +00:00
},
active: {
type: Boolean,
2020-02-24 18:44:50 +00:00
default: false,
},
},
}
2019-09-17 08:13:12 +00:00
</script>