summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/fields/basic_fields.js
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2020-05-08 13:38:55 +0000
committerqsm-odoo <qsm@odoo.com>2020-05-11 15:59:16 +0000
commit64629a3b4fe51fa562a8b3f39c8ba62ecc3742d8 (patch)
tree9773b5e416eafb046b10abf335524d5afe85a93c /addons/web/static/src/js/fields/basic_fields.js
parent4e5941624b94a8abcb14afcac7c8fa78da43173d (diff)
[FIX] website: allow using bold in blog posts with all fonts
Bootstrap uses `font-weight: bolder` for its `<b>` elements. This is good... but only works if the "bolder" font is actually referencing an available one. Indeed, since we only load 400 and 700 font weights for fonts, see the following table. CSS values on the left, actual fonts being used on the right. ``` <p> | <b> | <p> | <b> ---------------------- 100 400 | 400 400 200 400 | 400 400 300 400 | 400 400 400 700 | 400 700 -> ok 500 700 | 400 700 -> ok 600 900 | 700 700 700 900 | 700 700 800 900 | 700 700 900 900 | 700 700 ``` See how bolder and fallbacks works: [1] and [2]. With most fonts, the rendering of `<b>` was thus only working for elements using 400 or 500 font-weight. For font-weight > 500, we'll consider this as a limitation for now: bold area cannot be made bolder. Font-weights < 400 are however more important as used by some of Odoo and bootstrap style (e.g. the entire blog posts). The problem is even deeper as website visitors could have more or different available font-weights on their computer. This fix adds the loading of 300 weights for all fonts so that: - The displayed weights are more consistent across different computers. - Making a light text bolder through the editor works. [1]: https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight#Meaning_of_relative_weights [2]: https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight#Fallback_weights opw-2226573 closes odoo/odoo#51061 X-original-commit: e7496b923b097f677bef09b890c52b5a680cf53c Related: odoo/design-themes#277 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Diffstat (limited to 'addons/web/static/src/js/fields/basic_fields.js')
0 files changed, 0 insertions, 0 deletions