From 3a34e39caa8544059dfb1888edc29c62c3efde31 Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Wed, 8 Jul 2020 12:56:39 +0000 Subject: [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 --- .../web_editor/static/src/scss/web_editor.variables.scss | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'addons/web_editor/static/src/scss/web_editor.variables.scss') 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}; + } + } +} -- cgit v1.2.3