From 52ec536cef2ec84af0b36746f19a8cdf9f23fe2a Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Fri, 21 Dec 2018 10:37:10 +0000 Subject: [REF] *: make stronger bootstrap assets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 --- .../web/static/src/scss/bootstrap_overridden.scss | 88 ++++++++++------------ 1 file changed, 39 insertions(+), 49 deletions(-) (limited to 'addons/web/static/src/scss/bootstrap_overridden.scss') diff --git a/addons/web/static/src/scss/bootstrap_overridden.scss b/addons/web/static/src/scss/bootstrap_overridden.scss index 09dd5ddbfd4..edff888acbf 100644 --- a/addons/web/static/src/scss/bootstrap_overridden.scss +++ b/addons/web/static/src/scss/bootstrap_overridden.scss @@ -20,21 +20,21 @@ $gray-800: #343a40 !default; $gray-900: #212529 !default; $black: #000 !default; -$primary: $o-brand-primary; -$secondary: $white; +$primary: $o-brand-primary !default; +$secondary: $white !default; // Body // // Settings for the `` element. -$body-bg: $o-brand-secondary; -$body-color: $o-main-text-color; +$body-bg: $o-brand-secondary !default; +$body-color: $o-main-text-color !default; // Links // // Style anchor elements. -$link-hover-decoration: none; +$link-hover-decoration: none !default; // Muted // @@ -46,53 +46,53 @@ $text-muted: $gray-500 !default; // // Set the number of columns and specify the width of the gutters. -$grid-gutter-width: $o-horizontal-padding * 2; +$grid-gutter-width: $o-horizontal-padding * 2 !default; // Components // // Define common padding and border radius sizes and more. -$border-radius: 3px; +$border-radius: 3px !default; -$component-active-color: $o-brand-primary; -$component-active-bg: $gray-200; +$component-active-color: $o-brand-primary !default; +$component-active-bg: $gray-200 !default; // Fonts // // Font, line-height, and color for body text, headings, and more. -$font-family-sans-serif: "Lucida Grande", Helvetica, Verdana, Arial, sans-serif; +$font-family-sans-serif: "Lucida Grande", Helvetica, Verdana, Arial, sans-serif !default; -$font-size-base: $o-font-size-base; -$line-height-base: $o-line-height-base; +$font-size-base: $o-font-size-base !default; +$line-height-base: $o-line-height-base !default; -$h1-font-size: $o-font-size-base * 2.0; -$h2-font-size: $o-font-size-base * 1.5; -$h3-font-size: $o-font-size-base * 1.3; -$h4-font-size: $o-font-size-base * 1.2; -$h5-font-size: $o-font-size-base * 1.1; +$h1-font-size: $o-font-size-base * 2.0 !default; +$h2-font-size: $o-font-size-base * 1.5 !default; +$h3-font-size: $o-font-size-base * 1.3 !default; +$h4-font-size: $o-font-size-base * 1.2 !default; +$h5-font-size: $o-font-size-base * 1.1 !default; -$headings-font-weight: bold; +$headings-font-weight: bold !default; // Tables // // Customizes the `.table` component with basic values, each used across all table variations. -$table-accent-bg: rgba($black, .01); -$table-hover-bg: rgba($black, .04); +$table-accent-bg: rgba($black, .01) !default; +$table-hover-bg: rgba($black, .04) !default; // Dropdowns // // Dropdown menu container and contents. -$dropdown-border-color: $gray-300; +$dropdown-border-color: $gray-300 !default; -$dropdown-link-color: $o-main-text-color; -$dropdown-link-hover-color: $gray-900; -$dropdown-link-hover-bg: $gray-200; +$dropdown-link-color: $o-main-text-color !default; +$dropdown-link-hover-color: $gray-900 !default; +$dropdown-link-hover-bg: $gray-200 !default; -$dropdown-link-active-color: $gray-900; -$dropdown-link-active-bg: $gray-300; +$dropdown-link-active-color: $gray-900 !default; +$dropdown-link-active-bg: $gray-300 !default; // Z-index master list @@ -111,39 +111,29 @@ $dropdown-link-active-bg: $gray-300; // Navs -$nav-tabs-link-active-bg: $white; +$nav-tabs-link-active-bg: $white !default; -$nav-pills-border-radius: 0; -$nav-pills-link-active-color: $white; -$nav-pills-link-active-bg: $o-brand-primary; - -// Navbar - -// FIXME $navbar-height ? $navbar-margin-bottom ? $navbar-inverse-* ? $navbar-border-radius ? +$nav-pills-border-radius: 0 !default; +$nav-pills-link-active-color: $white !default; +$nav-pills-link-active-bg: $o-brand-primary !default; // Badges -// FIXME $badge-bg, $badge-color, $badge-line-height ? -$badge-font-weight: normal; +$badge-font-weight: normal !default; // Modals // Padding applied to the modal body -$modal-inner-padding: $o-horizontal-padding; +$modal-inner-padding: $o-horizontal-padding !default; -// FIXME $modal-title-padding ? - -$modal-lg: 980px; -$modal-md: 650px; +$modal-lg: 980px !default; +$modal-md: 650px !default; // Breadcrumbs -$breadcrumb-padding-y: 0; -$breadcrumb-padding-x: 0; -$breadcrumb-margin-bottom: 0; - -$breadcrumb-bg: $o-control-panel-background-color; -// FIXME $breadcrumb-color ? -$breadcrumb-active-color: #777777; +$breadcrumb-padding-y: 0 !default; +$breadcrumb-padding-x: 0 !default; +$breadcrumb-margin-bottom: 0 !default; -// FIXME $icon-font-path ? +$breadcrumb-bg: $o-control-panel-background-color !default; +$breadcrumb-active-color: #777777 !default; -- cgit v1.2.3