[REF] *: BS5: handle color overrides

This commit is a hack for Bootstrap 5
In Bootstrap 4 these variables was used with map-merge()
In Bootstrap 5 these variables has set only if they don't exist before

PS: Another fix will be to reorder all bundle to follow Bootstrap
documentation and do another logic that wasn't use before.

Ref:
https://getbootstrap.com/docs/5.1/customize/sass/#colors

Task ID: 2766483

Part-of: odoo/odoo#95450
This commit is contained in:
Romeo Fragomeli
2022-07-07 13:30:16 +02:00
parent 8d8afbddf5
commit fb3b9f96de
11 changed files with 98 additions and 0 deletions
+1
View File
@@ -192,6 +192,7 @@ Help your customers with this chat, and analyse their feedback.
('include', 'web._assets_helpers'),
'web/static/src/libs/bootstrap/pre_variables.scss',
'web/static/lib/bootstrap/scss/_variables.scss',
'im_livechat/static/src/scss/im_livechat_bootstrap.scss',
'im_livechat/static/src/legacy/public_livechat.scss',
+1
View File
@@ -70,6 +70,7 @@
# SCSS dependencies (the order is important)
('include', 'web._assets_helpers'),
'web/static/src/legacy/scss/bootstrap_overridden.scss',
'web/static/src/libs/bootstrap/pre_variables.scss',
'web/static/lib/bootstrap/scss/_variables.scss',
'web/static/src/legacy/scss/import_bootstrap.scss',
'web/static/src/legacy/scss/bootstrap_review.scss',
+1
View File
@@ -103,6 +103,7 @@
],
'mass_mailing.assets_mail_themes_edition': [
('include', 'web._assets_helpers'),
'web/static/src/libs/bootstrap/pre_variables.scss',
'web/static/lib/bootstrap/scss/_variables.scss',
'mass_mailing/static/src/scss/mass_mailing.ui.scss',
],
+1
View File
@@ -154,6 +154,7 @@
# It is expected to add other lines coming from the web.assets_frontend
# if we need to add more and more legacy stuff that would require other scss or js.
('include', 'web._assets_helpers'),
'web/static/src/libs/bootstrap/pre_variables.scss',
'web/static/lib/bootstrap/scss/_variables.scss',
('include', 'web.frontend_legacy'),
+1
View File
@@ -30,6 +30,7 @@ Allows users to send documents by post
],
'snailmail.report_assets_snailmail': [
('include', 'web._assets_helpers'),
'web/static/src/libs/bootstrap/pre_variables.scss',
'web/static/lib/bootstrap/scss/_variables.scss',
'snailmail/static/src/scss/snailmail_external_layout_asset.scss',
'snailmail/static/src/js/snailmail_external_layout.js',
+1
View File
@@ -70,6 +70,7 @@ sent mails with personal token for the invitation of the survey.
'survey/static/src/js/survey_result.js',
('include', 'web._assets_helpers'),
('include', 'web._assets_frontend_helpers'),
'web/static/src/libs/bootstrap/pre_variables.scss',
'web/static/lib/bootstrap/scss/_variables.scss',
'survey/static/src/scss/survey_templates_form.scss',
'survey/static/src/scss/survey_templates_results.scss',
+6
View File
@@ -66,6 +66,7 @@ This module provides the core of the Odoo Web Client.
'web.assets_common': [
('include', 'web._assets_helpers'),
'web/static/src/libs/bootstrap/pre_variables.scss',
'web/static/lib/bootstrap/scss/_variables.scss',
('include', 'web._assets_common_styles'),
@@ -85,6 +86,7 @@ This module provides the core of the Odoo Web Client.
('include', 'web._assets_helpers'),
('include', 'web._assets_backend_helpers'),
'web/static/src/libs/bootstrap/pre_variables.scss',
'web/static/lib/bootstrap/scss/_variables.scss',
('include', 'web._assets_bootstrap'),
@@ -202,6 +204,7 @@ This module provides the core of the Odoo Web Client.
"web.assets_backend_legacy_lazy": [
("include", "web._assets_helpers"),
('include', 'web._assets_backend_helpers'),
'web/static/src/libs/bootstrap/pre_variables.scss',
'web/static/lib/bootstrap/scss/_variables.scss',
# graph
'web/static/src/legacy/js/views/graph/**/*',
@@ -217,6 +220,7 @@ This module provides the core of the Odoo Web Client.
('include', 'web._assets_helpers'),
('include', 'web._assets_frontend_helpers'),
'web/static/src/libs/bootstrap/pre_variables.scss',
'web/static/lib/bootstrap/scss/_variables.scss',
'web/static/lib/luxon/luxon.js',
@@ -270,6 +274,7 @@ This module provides the core of the Odoo Web Client.
('include', 'web._assets_helpers'),
'web/static/src/legacy/scss/bootstrap_overridden_report.scss',
'web/static/src/libs/bootstrap/pre_variables.scss',
'web/static/lib/bootstrap/scss/_variables.scss',
('include', 'web._assets_bootstrap'),
@@ -512,6 +517,7 @@ This module provides the core of the Odoo Web Client.
# It is expected to add other lines coming from the web.assets_frontend
# if we need to add more and more legacy stuff that would require other scss or js.
('include', 'web._assets_helpers'),
'web/static/src/libs/bootstrap/pre_variables.scss',
'web/static/lib/bootstrap/scss/_variables.scss',
('include', 'web.frontend_legacy'),
@@ -0,0 +1,82 @@
// Hack for Bootstrap 5
// In Bootstrap 4 these variables was used with map-merge()
// In Bootstrap 5 these variables has set only if they don't exist before
// PS: Another fix will be to reorder all bundle to follow Bootstrap documentation and do another
// logic that wasn't use before
// Ref:
// https://getbootstrap.com/docs/5.1/customize/sass/#colors
// Need to be include before web/static/lib/bootstrap/scss/_variables.scss
$white: #fff !default;
$gray-100: #f8f9fa !default;
$gray-200: #e9ecef !default;
$gray-300: #dee2e6 !default;
$gray-400: #ced4da !default;
$gray-500: #adb5bd !default;
$gray-600: #6c757d !default;
$gray-700: #495057 !default;
$gray-800: #343a40 !default;
$gray-900: #212529 !default;
$black: #000 !default;
$grays: () !default;
$grays: map-merge((
"100": $gray-100,
"200": $gray-200,
"300": $gray-300,
"400": $gray-400,
"500": $gray-500,
"600": $gray-600,
"700": $gray-700,
"800": $gray-800,
"900": $gray-900
), $grays);
$blue: #0d6efd !default;
$indigo: #6610f2 !default;
$purple: #6f42c1 !default;
$pink: #d63384 !default;
$red: #dc3545 !default;
$orange: #fd7e14 !default;
$yellow: #ffc107 !default;
$green: #198754 !default;
$teal: #20c997 !default;
$cyan: #0dcaf0 !default;
$colors: () !default;
$colors: map-merge((
"blue": $blue,
"indigo": $indigo,
"purple": $purple,
"pink": $pink,
"red": $red,
"orange": $orange,
"yellow": $yellow,
"green": $green,
"teal": $teal,
"cyan": $cyan,
"white": $white,
"gray": $gray-600,
"gray-dark": $gray-800
), $colors);
$primary: $blue !default;
$secondary: $gray-600 !default;
$success: $green !default;
$info: $cyan !default;
$warning: $yellow !default;
$danger: $red !default;
$light: $gray-100 !default;
$dark: $gray-900 !default;
$theme-colors: () !default;
$theme-colors: map-merge((
"primary": $primary,
"secondary": $secondary,
"success": $success,
"info": $info,
"warning": $warning,
"danger": $danger,
"light": $light,
"dark": $dark
), $theme-colors);
+1
View File
@@ -64,6 +64,7 @@ Odoo Web Editor widget.
('include', 'web._assets_helpers'),
'web_editor/static/src/scss/bootstrap_overridden.scss',
'web/static/src/libs/bootstrap/pre_variables.scss',
'web/static/lib/bootstrap/scss/_variables.scss',
# integration
+2
View File
@@ -192,6 +192,7 @@
'website.assets_wysiwyg': [
('include', 'web._assets_helpers'),
'web_editor/static/src/scss/bootstrap_overridden.scss',
'web/static/src/libs/bootstrap/pre_variables.scss',
'web/static/lib/bootstrap/scss/_variables.scss',
'website/static/src/scss/website.wysiwyg.scss',
'website/static/src/scss/website.edit_mode.scss',
@@ -231,6 +232,7 @@
],
'website.assets_editor': [
('include', 'web._assets_helpers'),
'web/static/src/libs/bootstrap/pre_variables.scss',
'web/static/lib/bootstrap/scss/_variables.scss',
'website/static/src/components/ace_editor/ace_editor.js',
'website/static/src/components/ace_editor/ace_editor.scss',
+1
View File
@@ -108,6 +108,7 @@ Featuring
],
'website_slides.slide_embed_assets': [
('include', 'web._assets_helpers'),
'web/static/src/libs/bootstrap/pre_variables.scss',
'web/static/lib/bootstrap/scss/_variables.scss',
('include', 'web._assets_bootstrap'),
'website_slides/static/src/scss/website_slides.scss',