Skip to content

Commit

Permalink
Use variables for default colors in boolean interface/display (#10346)
Browse files Browse the repository at this point in the history
* Use variables for default colors in boolean interface/display

Fixes #10333

* Fix translations name
  • Loading branch information
rijkvanzanten committed Dec 6, 2021
1 parent d29acf3 commit 2897264
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 18 deletions.
4 changes: 2 additions & 2 deletions app/src/displays/boolean/boolean.vue
Expand Up @@ -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) {
Expand Down
6 changes: 0 additions & 6 deletions app/src/displays/boolean/index.ts
Expand Up @@ -65,9 +65,6 @@ export default defineDisplay({
interface: 'select-color',
width: 'half',
},
schema: {
default_value: '#00C897',
},
},
{
field: 'colorOff',
Expand All @@ -77,9 +74,6 @@ export default defineDisplay({
interface: 'select-color',
width: 'half',
},
schema: {
default_value: '#B0BEC5',
},
},
],
});
4 changes: 2 additions & 2 deletions app/src/interfaces/boolean/boolean.vue
Expand Up @@ -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'],
Expand Down
10 changes: 2 additions & 8 deletions app/src/interfaces/boolean/index.ts
Expand Up @@ -40,23 +40,17 @@ export default defineInterface({
name: '$t:interfaces.boolean.color_on',
type: 'string',
meta: {
width: 'half',
interface: 'select-color',
},
schema: {
default_value: '#00C897',
width: 'half',
},
},
{
field: 'colorOff',
name: '$t:interfaces.boolean.color_off',
type: 'string',
meta: {
width: 'half',
interface: 'select-color',
},
schema: {
default_value: '#B0BEC5',
width: 'half',
},
},
{
Expand Down

0 comments on commit 2897264

Please sign in to comment.