From fa4cc2f969cae5b9b4e2e4de8dbac7ab38f40cac Mon Sep 17 00:00:00 2001 From: Younn Olivier Date: Wed, 28 Sep 2022 08:05:43 +0000 Subject: [PATCH] [FIX] web, portal: re-introduce w-0 and h-0 utility classes When updating bootstrap to bootstrap 5 with [1], the h-0 and w-0 extended utility classes were lost. This commit adds them back, using the Utility API of Bootstrap described here [2], and the $utilities-sizes from [3]. Therefore, the code introduced in [4] is not needed anymore (those classes are now available in all Odoo instead of just the frontend). This commit fixes the footer "scroll to top" option of the website builder. [1]: https://github.com/odoo/odoo/commit/971e5a91aab9 [2]: https://getbootstrap.com/docs/5.0/utilities/api/ [3]: https://github.com/odoo/odoo/commit/e377a084174d [4]: https://github.com/odoo/odoo/commit/da55072a6935 closes odoo/odoo#101691 X-original-commit: 3a2ad02962fdea254ca46af1f7728b537a6af9cd Signed-off-by: Quentin Smetz (qsm) --- addons/portal/__manifest__.py | 1 - addons/portal/static/src/scss/bootstrap.extend.scss | 13 ------------- .../static/src/scss/bootstrap_overridden.scss | 6 ------ addons/web/static/src/scss/utilities_custom.scss | 2 ++ 4 files changed, 2 insertions(+), 20 deletions(-) delete mode 100644 addons/portal/static/src/scss/bootstrap.extend.scss diff --git a/addons/portal/__manifest__.py b/addons/portal/__manifest__.py index 46e14fff2ab..aedcb33877f 100644 --- a/addons/portal/__manifest__.py +++ b/addons/portal/__manifest__.py @@ -36,7 +36,6 @@ a dependency towards website editing and customization capabilities.""", 'portal/static/src/views/**/*', ], 'web.assets_frontend': [ - 'portal/static/src/scss/bootstrap.extend.scss', 'portal/static/src/scss/portal.scss', 'portal/static/src/js/portal.js', 'portal/static/src/js/portal_chatter.js', diff --git a/addons/portal/static/src/scss/bootstrap.extend.scss b/addons/portal/static/src/scss/bootstrap.extend.scss deleted file mode 100644 index 21eacb47df1..00000000000 --- a/addons/portal/static/src/scss/bootstrap.extend.scss +++ /dev/null @@ -1,13 +0,0 @@ -@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; } - } - } - } - } -} diff --git a/addons/portal/static/src/scss/bootstrap_overridden.scss b/addons/portal/static/src/scss/bootstrap_overridden.scss index 8527d8f0651..6b3031ae531 100644 --- a/addons/portal/static/src/scss/bootstrap_overridden.scss +++ b/addons/portal/static/src/scss/bootstrap_overridden.scss @@ -12,12 +12,6 @@ $gray-900: #212529 !default; $gray-300: #dee2e6 !default; -// This variable affects the `.h-*` and `.w-*` classes. -$sizes: () !default; -$sizes: map-merge(( - 0: 0, -), $sizes); - // Body // // Settings for the `` element. diff --git a/addons/web/static/src/scss/utilities_custom.scss b/addons/web/static/src/scss/utilities_custom.scss index 157795a4626..01ac4500901 100644 --- a/addons/web/static/src/scss/utilities_custom.scss +++ b/addons/web/static/src/scss/utilities_custom.scss @@ -98,12 +98,14 @@ $utilities: map-merge( map-get($utilities, "width"), ( responsive: true, + values: $utilities-sizes, ), ), "height": map-merge( map-get($utilities, "height"), ( responsive: true, + values: $utilities-sizes, ), ), "max-width": map-merge(