summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/scss/web_editor.variables.scss
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2020-07-08 12:56:39 +0000
committerqsm-odoo <qsm@odoo.com>2020-07-09 18:09:59 +0000
commit3a34e39caa8544059dfb1888edc29c62c3efde31 (patch)
treedd80524eaf83f61653ccd4ddfd79aebc283a7139 /addons/web_editor/static/src/scss/web_editor.variables.scss
parentec026e76ca910107d5b61b5bf9f44c5b904c29b1 (diff)
[REF] web_editor, *: review how html properties are printed (scss)
*: website Make sure strings are printed quoted and null values are not printed. Part of https://github.com/odoo/odoo/pull/54065 task-2291398
Diffstat (limited to 'addons/web_editor/static/src/scss/web_editor.variables.scss')
-rw-r--r--addons/web_editor/static/src/scss/web_editor.variables.scss15
1 files changed, 15 insertions, 0 deletions
diff --git a/addons/web_editor/static/src/scss/web_editor.variables.scss b/addons/web_editor/static/src/scss/web_editor.variables.scss
index fd89f662567..21ce8c9fe8d 100644
--- a/addons/web_editor/static/src/scss/web_editor.variables.scss
+++ b/addons/web_editor/static/src/scss/web_editor.variables.scss
@@ -440,3 +440,18 @@ $o-color-extras-nesting-selector: '&, .o_colored_level &';
@include o-bg-color(o-color($-related-color), $background: $background, $important: false);
}
}
+
+// Print a document property the right way (depending on the type of the printed
+// variable).
+@mixin print-variable($key, $value) {
+ @if $value != null {
+ $-type: type-of($value);
+ @if $-type == 'string' {
+ --#{$key}: '#{$value}';
+ } @else if $-type == 'list' {
+ --#{$key}: #{inspect($value)};
+ } @else {
+ --#{$key}: #{$value};
+ }
+ }
+}