Files
hoppscotch/components/settings/swatch.vue
2020-08-11 06:34:36 +05:30

66 lines
1.0 KiB
Vue

<template>
<div
class="color"
:data-color="color"
:class="{ active: active }"
v-tooltip="{ content: name || color }"
:style="{ backgroundColor: color }"
>
<i v-if="active" class="material-icons activeTick">done</i>
</div>
</template>
<style scoped lang="scss">
.color {
display: inline-flex;
align-items: center;
position: relative;
justify-content: center;
margin: 8px;
padding: 16px;
border-radius: 100%;
border: 3px solid var(--bg-dark-color);
cursor: pointer;
transition: all 0.2s ease-in-out;
&.fg {
color: var(--act-color);
}
&.active {
border: 3px solid var(--ac-color);
}
&.fg.active {
border: 3px solid var(--fg-color);
}
.activeTick {
position: absolute;
margin: auto;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
}
</style>
<script>
export default {
props: {
color: {
type: String,
required: true,
},
name: {
type: String,
},
active: {
type: Boolean,
default: false,
},
},
}
</script>