Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from Dec 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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