diff options
| author | qsm-odoo <qsm@odoo.com> | 2018-06-28 17:54:40 +0200 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2018-07-27 12:36:54 +0200 |
| commit | 76f714dca8957233ba3bbca73f340fa21244f5f2 (patch) | |
| tree | 277290260fcc328428b0c23a292d521a77a6d1b3 /addons/web/static/src/scss | |
| parent | cd3f5bbfda76da75a9c7528144020c7dfbdf81d3 (diff) | |
[REF] web, web_editor, *: review theme color extensions
* survey, website_slides
Before this commit, the web_editor app created bg and text classes its
own way for theming (alpha, beta, grays, ...). Now the system is far
more automatic by extending BS4 color maps.
Diffstat (limited to 'addons/web/static/src/scss')
5 files changed, 92 insertions, 1 deletions
diff --git a/addons/web/static/src/scss/bootstrap_overridden_frontend.scss b/addons/web/static/src/scss/bootstrap_overridden_frontend.scss index e69de29bb2d..19ced6c9d8f 100644 --- a/addons/web/static/src/scss/bootstrap_overridden_frontend.scss +++ b/addons/web/static/src/scss/bootstrap_overridden_frontend.scss @@ -0,0 +1,3 @@ + +$black: black; +$white: white; diff --git a/addons/web/static/src/scss/bs_mixins_overrides.scss b/addons/web/static/src/scss/bs_mixins_overrides.scss new file mode 100644 index 00000000000..fd08c94a217 --- /dev/null +++ b/addons/web/static/src/scss/bs_mixins_overrides.scss @@ -0,0 +1,38 @@ +//------------------------------------------------------------------------------ +// Bootstrap Mixins and Functions Extensions +// Those will affect the way bootstrap is generated wherever bootstrap is used +//------------------------------------------------------------------------------ + +// Override background utilities so that they come with a default contrasted +// color (especially useful in the frontend editor for example). Also modifies +// the way .text-muted elements are rendered in those environments. +@mixin bg-variant($parent, $color, $text-color: null) { + #{$parent} { + $-yiq-color: if($text-color, $text-color, color-yiq($color)); + background-color: $color !important; + color: $-yiq-color; // not important so that text utilities still work + + .text-muted { + color: rgba($-yiq-color, 0.4) !important; + } + } + a#{$parent}, + button#{$parent} { + $-darken-color: darken($color, 10%); + @include hover-focus { + background-color: $-darken-color !important; + color: if($text-color, $text-color, color-yiq($-darken-color)); + } + } +} +@mixin bg-gradient-variant($parent, $color, $text-color: null) { + #{$parent} { + $-yiq-color: if($text-color, $text-color, color-yiq($color)); + background: $color linear-gradient(180deg, mix($body-bg, $color, 15%), $color) repeat-x !important; + color: $-yiq-color; + + .text-muted { + color: rgba($-yiq-color, 0.4) !important; + } + } +} diff --git a/addons/web/static/src/scss/import_bootstrap.scss b/addons/web/static/src/scss/import_bootstrap.scss deleted file mode 100644 index cbd46a7afcf..00000000000 --- a/addons/web/static/src/scss/import_bootstrap.scss +++ /dev/null @@ -1 +0,0 @@ -@import "bootstrap"; diff --git a/addons/web/static/src/scss/import_bootstrap_part1.scss b/addons/web/static/src/scss/import_bootstrap_part1.scss new file mode 100644 index 00000000000..09f4d3579ac --- /dev/null +++ b/addons/web/static/src/scss/import_bootstrap_part1.scss @@ -0,0 +1,11 @@ + +// This file is importing bootstrap. While a simple "import "bootstrap";" +// should be enough, this does not allow overridding mixins. Overridding mixins +// is necessary for some of our need and allow to generate more efficient CSS +// than adding more rules. This file instead copies the first part of the +// content of the "bootstrap.scss" files to allow adding mixin overrides in +// between. + +@import "functions"; +@import "variables"; +@import "mixins"; diff --git a/addons/web/static/src/scss/import_bootstrap_part2.scss b/addons/web/static/src/scss/import_bootstrap_part2.scss new file mode 100644 index 00000000000..c15793019ad --- /dev/null +++ b/addons/web/static/src/scss/import_bootstrap_part2.scss @@ -0,0 +1,40 @@ + +// This file is importing bootstrap. While a simple "import "bootstrap";" +// should be enough, this does not allow overridding mixins. Overridding mixins +// is necessary for some of our need and allow to generate more efficient CSS +// than adding more rules. This file instead copies the second part of the +// content of the "bootstrap.scss" files to allow adding mixin overrides in +// between. + +@import "root"; +@import "reboot"; +@import "type"; +@import "images"; +@import "code"; +@import "grid"; +@import "tables"; +@import "forms"; +@import "buttons"; +@import "transitions"; +@import "dropdown"; +@import "button-group"; +@import "input-group"; +@import "custom-forms"; +@import "nav"; +@import "navbar"; +@import "card"; +@import "breadcrumb"; +@import "pagination"; +@import "badge"; +@import "jumbotron"; +@import "alert"; +@import "progress"; +@import "media"; +@import "list-group"; +@import "close"; +@import "modal"; +@import "tooltip"; +@import "popover"; +@import "carousel"; +@import "utilities"; +@import "print"; |
