diff options
| author | qsm-odoo <qsm@odoo.com> | 2020-08-06 13:07:53 +0000 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2020-08-24 14:10:31 +0000 |
| commit | 6b400c433b352d7dbba0d3770600857df4872c50 (patch) | |
| tree | a1c4f1f6c31c4957ccf3fbb2562ac2dd4ca87a2f /addons/website/static/src/scss | |
| parent | 488ba8b3541f6e00e69db9b74f3a229bd405a5c6 (diff) | |
[IMP] website: implement body image as a SCSS variable
This is unfortunately replacing old hacks by new ones but using SCSS
variables for this is more consistent with the rest of our website
customization possibilities.
The hack here is for the UI which is controlling two SCSS variables at
the same time (body-image and body-image-type). This has to be improved.
closes odoo/odoo#56420
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Diffstat (limited to 'addons/website/static/src/scss')
3 files changed, 15 insertions, 9 deletions
diff --git a/addons/website/static/src/scss/options/layout/option_custom_body_pattern.scss b/addons/website/static/src/scss/options/layout/option_custom_body_pattern.scss deleted file mode 100644 index 1e75db342be..00000000000 --- a/addons/website/static/src/scss/options/layout/option_custom_body_pattern.scss +++ /dev/null @@ -1,5 +0,0 @@ - -#wrapwrap { - background-size: auto; - background-repeat: repeat; -} diff --git a/addons/website/static/src/scss/primary_variables.scss b/addons/website/static/src/scss/primary_variables.scss index 3351c9da5ec..c4c6d80a446 100644 --- a/addons/website/static/src/scss/primary_variables.scss +++ b/addons/website/static/src/scss/primary_variables.scss @@ -244,6 +244,9 @@ $o-base-website-values-palette: ( 'font-size-base': 1rem, // Need a set value as the value is used in bootstrap_overridden files 'google-fonts': null, + 'body-image': null, + 'body-image-type': 'image', // 'image' or 'pattern' + 'color-palettes-number': null, // Default to the individual variables for each color palette type 'btn-primary-outline': false, diff --git a/addons/website/static/src/scss/website.scss b/addons/website/static/src/scss/website.scss index 6b2421d3b4f..a4c517cb1b3 100644 --- a/addons/website/static/src/scss/website.scss +++ b/addons/website/static/src/scss/website.scss @@ -59,10 +59,18 @@ $-seen-urls: (); } #wrapwrap { - background-size: cover; - background-repeat: no-repeat; - background-position: center; - background-attachment: fixed; + @if o-website-value('body-image') { + background-image: url("/#{str-slice(o-website-value('body-image'), 2)}"); + background-position: center; + background-attachment: fixed; + @if o-website-value('body-image-type') == 'pattern' { + background-size: auto; + background-repeat: repeat; + } @else { + background-size: cover; + background-repeat: no-repeat; + } + } @if ($o-theme-layout == 'boxed') { @include media-breakpoint-up(md) { |
