diff options
| author | qsm-odoo <qsm@odoo.com> | 2018-12-21 10:37:10 +0000 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2018-12-26 17:25:23 +0000 |
| commit | 52ec536cef2ec84af0b36746f19a8cdf9f23fe2a (patch) | |
| tree | 003b9e782fa078866d56f71a926338a65379e080 /addons/website/static/src | |
| parent | ec48392e39e551d9784f0431aa818f280edf9ce3 (diff) | |
[REF] *: make stronger bootstrap assets
* portal, theme_bootswatch, web, web_editor, website
With less2sass and bs3tobs4 tasks, the assets structure was reviewed to
handle the specificities of both framework and to prepare for our next
odoo tasks. In particular, the assets_helpers and bootstrap overrides
were basically split into 4 parts: utils, primary variables, secondary
variables and bootstrap variables.
(see https://github.com/odoo/odoo/commit/6e4db7d13a926845bf82f5b035afede42d6d5a89)
Using the !default system for the bootstrap variables parts seems now
a good improvement. This is part of what this commit does: adding the
default flag for all bootstrap variables overrides and inverting the
order of the files in the _assets_backend_helpers and
_assets_frontend_helpers templates. This allows to avoid code like this:
portal:
```
$body-bg: white;
```
website:
```
@if $var != null {
$body-bg: $var;
}
```
This code makes the body white with portal or equal to $var with website
if $var has a value. The same behavior in the new file order is achieved
with:
website:
```
$body-bg: $var !default;
```
portal:
```
$body-bg: white !default;
```
This order is now also followed for the _assets_secondary_variables
templates (there are only a few).
This commit also make better assets hierarchy by making website inherit
from portal assets (instead of web) and portal inherit from web_editor
assets (instead of web) (thus relying on strong dependencies instead of
installation order which is not always right for migrated databases).
closes odoo/odoo#29757
Diffstat (limited to 'addons/website/static/src')
| -rw-r--r-- | addons/website/static/src/scss/bootstrap_overridden.scss | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/addons/website/static/src/scss/bootstrap_overridden.scss b/addons/website/static/src/scss/bootstrap_overridden.scss index 8c21c748fe1..fbf776ae283 100644 --- a/addons/website/static/src/scss/bootstrap_overridden.scss +++ b/addons/website/static/src/scss/bootstrap_overridden.scss @@ -7,27 +7,25 @@ // depending on its contrast. Themes should be careful if they decide to // override those values. This would be simplified by giving the user the choice // for its dark *and* light text colors. -$-light: if($white != null, $white, #FFFFFF); -$-dark: if($gray-900 != null, $gray-900, #212529); -$-text: if(color('text') != null, color('text'), $-dark); -$-is-light: (o-get-most-contrast($-text, $-light, $-dark, color('body'), $cross-mix: false) == $-dark); -$yiq-text-light: if($-is-light, color('text'), null); -$yiq-text-dark: if($-is-light, null, color('text')); +$-light: if(palette-gray('white') != null, palette-gray('white'), #FFFFFF); +$-dark: if(palette-gray('900') != null, palette-gray('900'), #212529); +$-text: if(palette-color('text') != null, palette-color('text'), $-dark); +$-is-light: (o-get-most-contrast($-text, $-light, $-dark, palette-color('body'), $cross-mix: false) == $-dark); +$yiq-text-light: if($-is-light, palette-color('text'), null) !default; +$yiq-text-dark: if($-is-light, null, palette-color('text')) !default; // Body // // Settings for the `<body>` element. -@if color('body') { // Do not default to bootstrap but to the portal value - $body-bg: color('body'); -} -$body-color: color('text'); +$body-bg: palette-color('body') !default; +$body-color: palette-color('text') !default; // Fonts // // Font, line-height, and color for body text, headings, and more. -$font-family-sans-serif: nth($o-theme-fonts, $o-theme-font-number); +$font-family-sans-serif: nth($o-theme-fonts, $o-theme-font-number) !default; -$headings-font-family: nth($o-theme-fonts, $o-theme-headings-font-number); -$headings-color: color('h1'); +$headings-font-family: nth($o-theme-fonts, $o-theme-headings-font-number) !default; +$headings-color: palette-color('h1') !default; |
