diff --git a/CHANGELOG.md b/CHANGELOG.md index 7edae4b6..162cb09b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 1.4.2 + +- widgets + - remove `colorBg` for all widgets except containers + - widgets background color is now transparent by default (can be overridden with css) + ## 1.4.1 - bug fixes diff --git a/src/client/widgets/common/widget.js b/src/client/widgets/common/widget.js index 006fd613..2e2334ee 100644 --- a/src/client/widgets/common/widget.js +++ b/src/client/widgets/common/widget.js @@ -71,7 +71,6 @@ class Widget extends EventEmitter { _style: 'style', - colorBg: {type: 'string', value: 'auto', help: 'Panel background color. Set to "auto" to inherit from parent widget.'}, colorText: {type: 'string', value: 'auto', help: 'Text color. Set to "auto" to inherit from parent widget.'}, colorWidget: {type: 'string', value: 'auto', help: 'Widget\'s default accent color. Set to "auto" to inherit from parent widget.'}, colorStroke: {type: 'string', value: 'auto', help: 'Stroke color. Set to "auto" to use `colorWidget`.'}, diff --git a/src/client/widgets/containers/matrix.js b/src/client/widgets/containers/matrix.js index 9b66641d..a98365a3 100644 --- a/src/client/widgets/containers/matrix.js +++ b/src/client/widgets/containers/matrix.js @@ -19,6 +19,7 @@ class Matrix extends StaticProperties(Panel, {scroll: false}) { _class_specific: 'matrix', + colorBg: {type: 'string', value: 'auto', help: 'Panel background color. Set to "auto" to inherit from parent widget.'}, widgetType: {type: 'string', value: 'button', help: 'Defines the type of the widgets in the matrix'}, quantity: {type: 'number', value: 4, help: 'Defines the number of widgets in the matrix'}, start: {type: 'integer', value: 0, help: 'First widget\'s index'}, diff --git a/src/client/widgets/containers/modal.js b/src/client/widgets/containers/modal.js index 3e607638..1ce0b79b 100644 --- a/src/client/widgets/containers/modal.js +++ b/src/client/widgets/containers/modal.js @@ -20,6 +20,7 @@ class Modal extends Panel { _class_specific: 'modal', + colorBg: {type: 'string', value: 'auto', help: 'Panel background color. Set to "auto" to inherit from parent widget.'}, label: {type: 'string|boolean', value: 'auto', help: [ 'Set to `false` to hide completely', '- Insert icons using the prefix ^ followed by the icon\'s name : `^play`, `^pause`, etc (see https://fontawesome.com/icons?d=gallery&s=solid&m=free)', diff --git a/src/client/widgets/containers/panel.js b/src/client/widgets/containers/panel.js index 71aa06e7..b440a337 100644 --- a/src/client/widgets/containers/panel.js +++ b/src/client/widgets/containers/panel.js @@ -19,6 +19,7 @@ class Panel extends Container() { _class_specific: 'panel', + colorBg: {type: 'string', value: 'auto', help: 'Panel background color. Set to "auto" to inherit from parent widget.'}, variables: {type: '*', value: '@{parent.variables}', help: 'Defines one or more arbitrary variables that can be inherited by children widgets'}, traversing: {type: 'boolean', value: false, help: 'Set to `true` to enable traversing gestures in this widget. Set to `smart` or `auto` to limit affected widgets by the type of the first touched widget'}, @@ -241,6 +242,8 @@ class Panel extends Container() { this.setTraversing() return + case 'colorBg': + this.setCssVariables() case 'colorText': case 'colorWidget': case 'colorFill': @@ -248,7 +251,6 @@ class Panel extends Container() { case 'alphaStroke': case 'alphaFillOff': case 'alphaFillOn': - case 'colorBg': case 'padding': for (var w of this.children) { if (w) w.onPropChanged(propName) @@ -286,7 +288,12 @@ class Panel extends Container() { } +Panel.cssVariables = Panel.prototype.constructor.cssVariables.concat( + {js: 'colorBg', css: '--color-background'} +) + Panel.dynamicProps = Panel.prototype.constructor.dynamicProps.concat( + 'colorBg', 'variables', 'traversing' ) diff --git a/src/client/widgets/containers/root.js b/src/client/widgets/containers/root.js index f9d59fc6..0e03956c 100644 --- a/src/client/widgets/containers/root.js +++ b/src/client/widgets/containers/root.js @@ -16,6 +16,7 @@ class Root extends StaticProperties(Panel, {visible: true, label: false, id: 'ro _class_specific: 'panel', + colorBg: {type: 'string', value: 'auto', help: 'Panel background color. Set to "auto" to inherit from parent widget.'}, variables: {type: '*', value: '@{parent.variables}', help: 'Defines one or more arbitrary variables that can be inherited by children widgets'}, traversing: {type: 'boolean', value: false, help: 'Set to `true` to enable traversing gestures in this widget. Set to `smart` or `auto` to limit affected widgets by the type of the first touched widget'}, diff --git a/src/client/widgets/containers/tab.js b/src/client/widgets/containers/tab.js index 75413a37..d634728e 100644 --- a/src/client/widgets/containers/tab.js +++ b/src/client/widgets/containers/tab.js @@ -18,6 +18,7 @@ class Tab extends Panel { _class_specific: 'panel', + colorBg: {type: 'string', value: 'auto', help: 'Panel background color. Set to "auto" to inherit from parent widget.'}, label: {type: 'string|boolean', value: 'auto', help: [ 'Set to `false` to hide completely', '- Insert icons using the prefix ^ followed by the icon\'s name : `^play`, `^pause`, etc (see https://fontawesome.com/icons?d=gallery&s=solid&m=free)', diff --git a/src/scss/widgets.scss b/src/scss/widgets.scss index 25a41eaa..98fade9d 100644 --- a/src/scss/widgets.scss +++ b/src/scss/widgets.scss @@ -40,7 +40,7 @@ color: var(--color-text); - background-color: var(--color-background); + background-color: transparent; background-clip: content-box;