[FIX] website: remove "rem" unit from body line height theme option

Since [1] the line height is specified as an absolute height instead of
a ratio of the font size. This leads to multiline text with big font
sizes to overlap.

This commit removes the `rem` unit from the `body-line-height` primary
SCSS variable.

Steps to reproduce:
- Drop a text snippet.
- Select a paragraph.
- Change font size to 62.

=> Lines of paragraph did overlap.

In case the value had been edited before this fix, it will be shown
with the "rem" text within the option, which can be removed to update
the value to the correct behavior.

[1]: https://github.com/odoo/odoo/commit/388e4bb2bfcaebdd4ff30277fb49a034592d7086

task-3471117

closes odoo/odoo#133401

X-original-commit: a368dad33d128c95262053769e3f5de852d2be3a
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
This commit is contained in:
Benoit Socias
2023-08-29 07:48:17 +00:00
parent 2e3b13c040
commit 89c93aba75
3 changed files with 13 additions and 4 deletions
@@ -82,6 +82,17 @@ const wSnippetMenu = weSnippetEditor.SnippetsMenu.extend({
FontFamilyPickerUserValueWidget.prototype.fontVariables = fontVariables;
return this._super(...arguments);
},
/**
* @override
*/
_patchForComputeSnippetTemplates($html) {
// TODO Remove in master.
const themeBodyLineHeightEl = $html.find(
"[data-selector='theme-paragraph'] we-input[data-customize-website-variable][data-variable='body-line-height']"
)[0];
delete themeBodyLineHeightEl.dataset.unit;
delete themeBodyLineHeightEl.dataset.saveUnit;
},
/**
* Depending of the demand, reconfigure they gmap key or configure it
* if not already defined.
@@ -1954,7 +1954,7 @@ $o-selected-color-palettes-names: (
$o-base-website-values-palette: (
'font-size-base': 1rem, // Need a set value as the value is used in bootstrap_overridden files
'body-line-height': 1.5rem,
'body-line-height': 1.5,
'headings-line-height': 1.2,
'paragraph-margin-top': 0,
'paragraph-margin-bottom': 16px,
+1 -3
View File
@@ -1557,9 +1557,7 @@
<we-input string="Line height"
data-customize-website-variable="null"
data-variable="body-line-height"
data-fake-unit="× "
data-unit="rem"
data-save-unit="rem"/>
data-fake-unit="× "/>
<we-row string="Margins">
<we-input title="Top" data-customize-website-variable="" data-variable="paragraph-margin-top" data-unit="px" data-save-unit="px"/>
<we-input title="Bottom" data-customize-website-variable="" data-variable="paragraph-margin-bottom" data-unit="px" data-save-unit="px"/>