Last active
May 28, 2021 05:24
-
-
Save lapshinmr/7b8fe062f776d07a53ce9c2884dac9c1 to your computer and use it in GitHub Desktop.
Revisions
-
lapshinmr revised this gist
May 28, 2021 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -58,6 +58,7 @@ input display: none label display: block height: 5vh width: 5vh margin-bottom: 0 -
lapshinmr created this gist
Nov 5, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,76 @@ <template> <div> <div v-for="(color, colorName, index) in colorThemes" > <input type="radio" name="theme" :id="'color' + index" :value="colorName" v-model="colorTheme" > <label :for="'color' + index" :style="label(colorName)" > </label> </div> </div> </template> <script> import { mapActions } from 'vuex'; import { COLOR_THEMES } from '@/constants' export default { name: 'color-settings', data() { return { colorThemes: COLOR_THEMES } }, computed: { colorTheme: { get() { return this.$store.state.colorTheme }, set(colorTheme) { this.setColorTheme(colorTheme) } }, }, methods: { ...mapActions([ 'setColorTheme' ]), label: function(colorName) { return { '--color-background': this.colorTheme === colorName ? this.colorThemes[colorName].dark : this.colorThemes[colorName].primary, '--color-hover': this.colorTheme === colorName ? this.colorThemes[colorName].superDark : this.colorThemes[colorName].dark } } } } </script> <style lang="sass" scoped> input display: none label height: 5vh width: 5vh margin-bottom: 0 border-radius: 50% cursor: pointer transition: all 0.15s background-color: var(--color-background) input:checked + label background-color: var(--color-background)!important box-shadow: 0 0 10px var(--color-hover) label, input:checked + label &:hover background-color: var(--color-hover)!important </style>