From 46dca09cc4dd22a1218ce337510e0aa10d455e20 Mon Sep 17 00:00:00 2001 From: "stefanorigano (SRI)" Date: Mon, 4 Sep 2023 13:12:28 +0200 Subject: [PATCH] [FIX] web, crm, fleet, sale: font-weight Establish a set of target font-weight values (may not directly match the final result on screen). Enable the system to naturally utilize the "bolder" font-weight. Remove previous customizations designed for "Roboto" that clashed with certain system-fonts. Enforce the "normal" font-weight for icons, regardless by their parent design. Adapts some kanban titles. closes odoo/odoo#134824 X-original-commit: 74fce06cad4000a3894757d4fef9074b64153b7b Related: odoo/enterprise#47140 Signed-off-by: Pierre Paridans (app) Co-authored-by: Brieuc-brd --- addons/crm/views/crm_lead_views.xml | 4 ++-- addons/fleet/views/fleet_vehicle_cost_views.xml | 4 ++-- .../static/src/scss/partner_autocomplete.scss | 3 --- addons/sale/views/product_product_views.xml | 4 ++-- .../web/static/src/scss/bootstrap_overridden.scss | 7 ++++--- addons/web/static/src/scss/primary_variables.scss | 15 +++++++++++++++ .../static/src/views/widgets/ribbon/ribbon.scss | 2 +- addons/web/static/src/webclient/icons.scss | 6 ++++++ addons/web/static/src/webclient/webclient.scss | 8 -------- 9 files changed, 32 insertions(+), 21 deletions(-) diff --git a/addons/crm/views/crm_lead_views.xml b/addons/crm/views/crm_lead_views.xml index 3a22a5a2558..807238547d7 100644 --- a/addons/crm/views/crm_lead_views.xml +++ b/addons/crm/views/crm_lead_views.xml @@ -564,8 +564,8 @@
-
- +
+
diff --git a/addons/fleet/views/fleet_vehicle_cost_views.xml b/addons/fleet/views/fleet_vehicle_cost_views.xml index 80af4774f63..056c1e382b9 100644 --- a/addons/fleet/views/fleet_vehicle_cost_views.xml +++ b/addons/fleet/views/fleet_vehicle_cost_views.xml @@ -300,8 +300,8 @@
-
- +
+ diff --git a/addons/partner_autocomplete/static/src/scss/partner_autocomplete.scss b/addons/partner_autocomplete/static/src/scss/partner_autocomplete.scss index 3e608dbdc69..0f4127d2d6e 100644 --- a/addons/partner_autocomplete/static/src/scss/partner_autocomplete.scss +++ b/addons/partner_autocomplete/static/src/scss/partner_autocomplete.scss @@ -12,9 +12,6 @@ > * { @include o-text-overflow(block); } - > strong { - font-weight: $font-weight-bolder; - } } } } diff --git a/addons/sale/views/product_product_views.xml b/addons/sale/views/product_product_views.xml index ba4aeef046a..547594107b8 100644 --- a/addons/sale/views/product_product_views.xml +++ b/addons/sale/views/product_product_views.xml @@ -23,8 +23,8 @@
-

- +

+

diff --git a/addons/web/static/src/scss/bootstrap_overridden.scss b/addons/web/static/src/scss/bootstrap_overridden.scss index 8693e281e2f..91caeb6a0a4 100644 --- a/addons/web/static/src/scss/bootstrap_overridden.scss +++ b/addons/web/static/src/scss/bootstrap_overridden.scss @@ -106,9 +106,10 @@ $caret-width: 4px !default; // // Font, line-height, and color for body text, headings, and more. -$font-weight-normal: 400 !default; -$font-weight-bold: 500 !default; -$font-weight-bolder: 700 !default; +// Desired weights, not necessarily matching the final result on screen. +// Check primary_variables.scss for more info. +$font-weight-normal: $o-font-weight-normal !default; +$font-weight-bold: $o-font-weight-medium !default; $font-family-sans-serif: $o-font-family-sans-serif !default; diff --git a/addons/web/static/src/scss/primary_variables.scss b/addons/web/static/src/scss/primary_variables.scss index e1a333000e5..2ee69b95add 100644 --- a/addons/web/static/src/scss/primary_variables.scss +++ b/addons/web/static/src/scss/primary_variables.scss @@ -24,6 +24,21 @@ $o-line-height-base: 1.5 !default; // This is BS default // automatically added. $o-system-fonts: (-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Ubuntu, "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji") !default; + +// Font weights +// Caution: These values represent the desired font weights, but they may vary +// depending on the user's operating system. +// Because we rely on system fonts, the browser will interpret these values +// based on the available fonts on the user's device. +// If the exact font weight is unavailable, the browser will attempt to assign +// a suitable weight using the fallowing fallback scheme. +// https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight#fallback_weights + +$o-font-weight-normal: 400 !default; +$o-font-weight-medium: 500 !default; +$o-font-weight-bold: 700 !default; +$o-font-weight-extrabold: 800 !default; + // Colors // This is BS default $o-white: #FFFFFF !default; diff --git a/addons/web/static/src/views/widgets/ribbon/ribbon.scss b/addons/web/static/src/views/widgets/ribbon/ribbon.scss index 9a87bbc3461..192c18003c5 100644 --- a/addons/web/static/src/views/widgets/ribbon/ribbon.scss +++ b/addons/web/static/src/views/widgets/ribbon/ribbon.scss @@ -22,7 +22,7 @@ color: $white; font-size: var(--Ribbon-font-size, var(--Ribbon-font-size-default)); line-height: var(--Ribbon-height, var(--Ribbon-height-default)); - font-weight: $font-weight-bolder; + font-weight: $o-font-weight-bold; font-family: 'Lato', sans-serif; text-shadow: 0 1px 1px rgba(0, 0, 0, .2); text-transform: uppercase; diff --git a/addons/web/static/src/webclient/icons.scss b/addons/web/static/src/webclient/icons.scss index 5ae838b3e2b..9477bb97374 100644 --- a/addons/web/static/src/webclient/icons.scss +++ b/addons/web/static/src/webclient/icons.scss @@ -26,6 +26,12 @@ $oi-sizes: ( ), ); +// Force font-weight to normal +// ---------------------------------------------------------------------------- +.oi, .fa { + font-weight: $font-weight-normal; +} + // Define base-classes' properties using CSS variables. // Allows to dinamically update rules according to the context and eventual // utility classes. diff --git a/addons/web/static/src/webclient/webclient.scss b/addons/web/static/src/webclient/webclient.scss index ab5be96041c..3779debd810 100644 --- a/addons/web/static/src/webclient/webclient.scss +++ b/addons/web/static/src/webclient/webclient.scss @@ -218,14 +218,6 @@ select { // Misc. //------------------------------------------------------------------------------ -// By default, and are set to `$font-weight-bolder`. -// Override with `$font-weight-bold` in order to ensure consistency with default -// bold text, while keeping `$font-weight-bolder` variable untouched for specific -// uses (eg. '.fw-bolder' class). -b, strong { - font-weight: $font-weight-bold; -} - //== Titles @include media-breakpoint-down(md) { h1 {