From da55072a693527de58cedb5357d8bff84ab5d99a Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Fri, 14 Sep 2018 10:47:37 +0200 Subject: [PATCH] [FIX] portal, *: introduce responsive BS sizing classes * website_sale Bootstrap chose not to implement this feature, probably relying on their grid system (see https://github.com/twbs/bootstrap/issues/21943). We have a case where a responsive size of 0px is needed though: applied on a table, this forces the table to its contents' natural width. So this commit implements the behavior and adds the size of 0 to replace the non-responsive class 'o_table_column_fit'. --- .../portal/static/src/scss/bootstrap.extend.scss | 14 ++++++++++++++ .../static/src/scss/bootstrap_overridden.scss | 5 +++++ addons/portal/static/src/scss/portal.scss | 5 ----- addons/website_sale/views/templates.xml | 2 +- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/addons/portal/static/src/scss/bootstrap.extend.scss b/addons/portal/static/src/scss/bootstrap.extend.scss index 44e5f075ef7..4c4ed02c89a 100644 --- a/addons/portal/static/src/scss/bootstrap.extend.scss +++ b/addons/portal/static/src/scss/bootstrap.extend.scss @@ -1,3 +1,17 @@ +@each $breakpoint in map-keys($grid-breakpoints) { + @include media-breakpoint-up($breakpoint) { + $infix: breakpoint-infix($breakpoint, $grid-breakpoints); + + @if $infix != '' { // Standard ones are already created by bootstrap + @each $prop, $abbrev in (width: w, height: h) { + @each $size, $length in $sizes { + .#{$abbrev}#{$infix}-#{$size} { #{$prop}: $length !important; } + } + } + } + } +} + .text-left-not-xs, .text-left-not-sm, .text-left-not-md, .text-left-not-lg { text-align: left; } diff --git a/addons/portal/static/src/scss/bootstrap_overridden.scss b/addons/portal/static/src/scss/bootstrap_overridden.scss index 057349a08bf..2fc73b519ae 100644 --- a/addons/portal/static/src/scss/bootstrap_overridden.scss +++ b/addons/portal/static/src/scss/bootstrap_overridden.scss @@ -1,3 +1,8 @@ +// This variable affects the `.h-*` and `.w-*` classes. +$sizes: ( + 0: 0, +); + // Fonts // // Font, line-height, and color for body text, headings, and more. diff --git a/addons/portal/static/src/scss/portal.scss b/addons/portal/static/src/scss/portal.scss index cbcd61d5187..6b82294ee09 100644 --- a/addons/portal/static/src/scss/portal.scss +++ b/addons/portal/static/src/scss/portal.scss @@ -184,11 +184,6 @@ hr { @extend %o-page-header; } -// Force table to their minimum width for fitting their col-*-auto parent -.table.o_table_column_fit { - width: 1px; -} - // Images spacing img, .media_iframe_video, .o_image { &.float-right { diff --git a/addons/website_sale/views/templates.xml b/addons/website_sale/views/templates.xml index cf19002ba1c..055973b53ce 100644 --- a/addons/website_sale/views/templates.xml +++ b/addons/website_sale/views/templates.xml @@ -1413,7 +1413,7 @@ Your cart is empty!
- +
Product