diff --git a/addons/im_livechat/__manifest__.py b/addons/im_livechat/__manifest__.py index ab36951cc6d..d29c000b6c3 100644 --- a/addons/im_livechat/__manifest__.py +++ b/addons/im_livechat/__manifest__.py @@ -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', diff --git a/addons/mail/__manifest__.py b/addons/mail/__manifest__.py index 092a1155946..838d99efc98 100644 --- a/addons/mail/__manifest__.py +++ b/addons/mail/__manifest__.py @@ -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', diff --git a/addons/mass_mailing/__manifest__.py b/addons/mass_mailing/__manifest__.py index 85b9c2e55db..fa03cd429a1 100644 --- a/addons/mass_mailing/__manifest__.py +++ b/addons/mass_mailing/__manifest__.py @@ -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', ], diff --git a/addons/point_of_sale/__manifest__.py b/addons/point_of_sale/__manifest__.py index ab5d6db2e95..ec16aeecab8 100644 --- a/addons/point_of_sale/__manifest__.py +++ b/addons/point_of_sale/__manifest__.py @@ -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'), diff --git a/addons/snailmail/__manifest__.py b/addons/snailmail/__manifest__.py index 888a7bf7744..0079a1ca7b8 100644 --- a/addons/snailmail/__manifest__.py +++ b/addons/snailmail/__manifest__.py @@ -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', diff --git a/addons/survey/__manifest__.py b/addons/survey/__manifest__.py index 1b36cf5bbc6..cb8f221dd49 100644 --- a/addons/survey/__manifest__.py +++ b/addons/survey/__manifest__.py @@ -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', diff --git a/addons/web/__manifest__.py b/addons/web/__manifest__.py index d9bb32f49c4..97cb7247117 100644 --- a/addons/web/__manifest__.py +++ b/addons/web/__manifest__.py @@ -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'), diff --git a/addons/web/static/src/libs/bootstrap/pre_variables.scss b/addons/web/static/src/libs/bootstrap/pre_variables.scss new file mode 100644 index 00000000000..8b8e1ca0956 --- /dev/null +++ b/addons/web/static/src/libs/bootstrap/pre_variables.scss @@ -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); diff --git a/addons/web_editor/__manifest__.py b/addons/web_editor/__manifest__.py index fc7b2453905..de91b072837 100644 --- a/addons/web_editor/__manifest__.py +++ b/addons/web_editor/__manifest__.py @@ -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 diff --git a/addons/website/__manifest__.py b/addons/website/__manifest__.py index 4e3a07ab426..9ccd70a452c 100644 --- a/addons/website/__manifest__.py +++ b/addons/website/__manifest__.py @@ -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', diff --git a/addons/website_slides/__manifest__.py b/addons/website_slides/__manifest__.py index 2bca7aade8c..30fb086c955 100644 --- a/addons/website_slides/__manifest__.py +++ b/addons/website_slides/__manifest__.py @@ -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',