computed color display support in color_input

This commit is contained in:
Henry Jameson 2020-01-13 01:55:10 +02:00
parent fa2fcc8827
commit 5881c13adc
2 changed files with 11 additions and 0 deletions

View file

@ -31,11 +31,14 @@
height: 100%;
}
}
.computedIndicator,
.transparentIndicator {
flex: 0 0 2em;
min-width: 2em;
align-self: center;
height: 100%;
}
.transparentIndicator {
// forgot to install counter-strike source, ooops
background-color: #FF00FF;
position: relative;

View file

@ -38,6 +38,11 @@
v-if="transparentColor"
class="transparentIndicator"
/>
<div
v-if="computedColor"
class="computedIndicator"
:style="{backgroundColor: fallback}"
/>
</div>
</div>
</template>
@ -95,6 +100,9 @@ export default {
},
transparentColor () {
return this.value === 'transparent'
},
computedColor () {
return this.value && this.value.startsWith('--')
}
}
}