Use variables for default colors in boolean interface/display (#10346)

* Use variables for default colors in boolean interface/display

Fixes #10333

* Fix translations name
This commit is contained in:
Rijk van Zanten
2021-12-06 14:19:43 -05:00
committed by GitHub
parent d29acf3a00
commit 2897264acb
4 changed files with 6 additions and 18 deletions

View File

@@ -35,11 +35,11 @@ export default defineComponent({
},
colorOn: {
type: String,
default: '#00C897',
default: 'var(--primary)',
},
colorOff: {
type: String,
default: '#B0BEC5',
default: 'var(--foreground-subdued)',
},
},
setup(props) {

View File

@@ -65,9 +65,6 @@ export default defineDisplay({
interface: 'select-color',
width: 'half',
},
schema: {
default_value: '#00C897',
},
},
{
field: 'colorOff',
@@ -77,9 +74,6 @@ export default defineDisplay({
interface: 'select-color',
width: 'half',
},
schema: {
default_value: '#B0BEC5',
},
},
],
});

View File

@@ -43,11 +43,11 @@ export default defineComponent({
},
colorOn: {
type: String,
default: '#00C897',
default: 'var(--primary)',
},
colorOff: {
type: String,
default: '#B0BEC5',
default: 'var(--foreground-subdued)',
},
},
emits: ['input'],

View File

@@ -40,11 +40,8 @@ export default defineInterface({
name: '$t:interfaces.boolean.color_on',
type: 'string',
meta: {
width: 'half',
interface: 'select-color',
},
schema: {
default_value: '#00C897',
width: 'half',
},
},
{
@@ -52,11 +49,8 @@ export default defineInterface({
name: '$t:interfaces.boolean.color_off',
type: 'string',
meta: {
width: 'half',
interface: 'select-color',
},
schema: {
default_value: '#B0BEC5',
width: 'half',
},
},
{