From 8020cbf5644e07645a1f6617c94a4e01ed0e3ef5 Mon Sep 17 00:00:00 2001 From: Elisabeth Dickinson Date: Thu, 29 Dec 2022 11:13:17 +0100 Subject: [PATCH] [IMP][CSS]Change order of imported scss files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The aim of this cleanup is to use as many bootstrap classes, functions and utilities as possible to reduce the amount of extra code. Instead of redefining variables, BS variables are overridden in the bootstrap_overridden file. In order to be able to reuse these overridden variables within our own custom variable file — and after consultation with SRI — it was determined that the variables.scss file should come after the bootstrap files in the order of importation, unlike the order of odoo website's scss files. Changes to variables in bootstrap_overridden have been made to adapt to the new structure. --- .../odoo_theme/static/scss/_variables.scss | 9 ----- .../static/scss/bootstrap_overridden.scss | 38 +++++++++++-------- extensions/odoo_theme/static/style.scss | 2 +- 3 files changed, 24 insertions(+), 25 deletions(-) diff --git a/extensions/odoo_theme/static/scss/_variables.scss b/extensions/odoo_theme/static/scss/_variables.scss index 49b2d567b..10196aeeb 100644 --- a/extensions/odoo_theme/static/scss/_variables.scss +++ b/extensions/odoo_theme/static/scss/_variables.scss @@ -118,15 +118,6 @@ $o-gray-border: $gray-400; $o-gray-bg: $gray-200; $o-gray-color: $gray-900; -$o-violet : #7A436B; //Odoo's #875a7b Doesn't give AAA contrast on white background -$o-blue : #77b5d1; -$o-cyan: #0dcaf0; -$o-teal : #017e84; -$o-green : #519161; -$o-orange: #f39c1e; -$o-red: #D9534F; -$o-red-light: #FF5722; - $o-literals-bg: $gray-200; $o-literals-border: $o-literals-bg; diff --git a/extensions/odoo_theme/static/scss/bootstrap_overridden.scss b/extensions/odoo_theme/static/scss/bootstrap_overridden.scss index 7a48f1e55..9ae8d9f5f 100644 --- a/extensions/odoo_theme/static/scss/bootstrap_overridden.scss +++ b/extensions/odoo_theme/static/scss/bootstrap_overridden.scss @@ -4,18 +4,6 @@ /* $enable-responsive-font-sizes: true; */ // Colors -$blue: $o-blue; -$purple: $o-violet; -$cyan: $o-cyan; -$red: $o-red; -$orange: $o-orange; -$green: $o-green; -$teal: $o-teal; - -$primary: $o-teal; -$secondary: $o-violet; -$light: $o-light; -$dark: $o-dark; $white: #FFFFFF; $gray-100: #F8F8F8 !default; $gray-200: #F2F2F2 !default; @@ -26,6 +14,19 @@ $gray-600: #888888 !default; $gray-700: #707070 !default; $gray-800: #343A40 !default; $gray-900: #282F33 !default; + +$blue: #77b5d1; +$purple: #714B67; +$cyan: #0dcaf0; +$red: #D9534F; +$orange: #f39c1e; +$green: #519161; +$teal: #017e84; + +$primary: $teal; +$secondary: $purple; +$light: $gray-100; +$dark: $gray-600; $success: $green; $info: $blue; $warning: $orange; @@ -44,6 +45,13 @@ $h4-font-size: $font-size-base * 1.266 !default; $h5-font-size: $font-size-base * 1.125 !default; $h6-font-size: $font-size-base !default; + +$font-weight-lighter: 200; +$font-weight-light: 300; +$font-weight-normal: 400; +$font-weight-bold: 600; +$font-weight-bolder: 800; + // Images $thumbnail-padding: .5rem; @@ -52,7 +60,7 @@ $thumbnail-padding: .5rem; // For each of Bootstrap's buttons, define text, background, and border color. $btn-font-size: .875rem; -$btn-font-weight: $fw_semibold; +$btn-font-weight: $font-weight-medium; $btn-close-focus-shadow: 0 0 0 0 transparent; $btn-close-bg: url('data:image/svg+xml,'); $btn-close-width: 2rem; @@ -77,8 +85,8 @@ $modal-xl: fit-content; // Accordion $accordion-body-padding-y: 0 !default; $accordion-body-padding-x: 0 !default; -$accordion-color: shade-color($o-accordion-bg, 60%) !default; -$accordion-bg: $o-accordion-bg; +$accordion-color: shade-color($gray-200, 60%) !default; +$accordion-bg: $gray-200; $accordion-button-color: $accordion-color !default; $accordion-button-active-color: $accordion-button-color !default; diff --git a/extensions/odoo_theme/static/style.scss b/extensions/odoo_theme/static/style.scss index 846e8af28..74233779d 100644 --- a/extensions/odoo_theme/static/style.scss +++ b/extensions/odoo_theme/static/style.scss @@ -1,8 +1,8 @@ @import "scss/bootstrap_scss/_functions.scss"; @import "scss/_sphinx_basic"; -@import "scss/_variables"; @import "scss/bootstrap_overridden"; @import "scss/bootstrap_scss/bootstrap"; +@import "scss/_variables"; @import "scss/_mixins"; @import "scss/_typography"; @import "scss/_iconfont";