summaryrefslogtreecommitdiff
path: root/addons/web/static/src/scss/utils.scss
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2019-09-23 13:16:10 +0000
committerqsm-odoo <qsm@odoo.com>2019-09-24 08:44:28 +0000
commit87b05cf224659da1df8eb35469cfbb0c6ef6b64a (patch)
tree15f36225a3429a70d3d9a3f697c0b41a7e565647 /addons/web/static/src/scss/utils.scss
parentcf60a783fc6ecc3c9d1fc1966ba7434eb84afd0d (diff)
[REF] website, *: improve use of unicode support font
* web, theme_bootswatch Improvement of https://github.com/odoo/odoo/commit/02a321cffb2da60a86b960e75c445e37094567b4 - Clarify the name of the support font (to distinguish it from standard and google fonts and avoid confusion with Noto Sans and Noto Serif). - Make sure the support font is added and can be added for all font definitions in odoo scss files thanks to a scss function. Could be backported in 12.0 if judged necessary. Part of https://github.com/odoo/odoo/pull/37293
Diffstat (limited to 'addons/web/static/src/scss/utils.scss')
-rw-r--r--addons/web/static/src/scss/utils.scss23
1 files changed, 23 insertions, 0 deletions
diff --git a/addons/web/static/src/scss/utils.scss b/addons/web/static/src/scss/utils.scss
index 9c3187d01bc..77d9749111f 100644
--- a/addons/web/static/src/scss/utils.scss
+++ b/addons/web/static/src/scss/utils.scss
@@ -173,6 +173,29 @@
}
}
+// Odoo defines a limited Noto font-family for a small variety of unicode
+// characters that are not necessary defined in the user system or even defined
+// but not properly readable. This function allows to add this font family in a
+// given font list.
+//
+// @param {list} $font - a list of font names ending with the generic one.
+// @param {integer} [$index] - the position where to add the support font, if
+// not given, it will be placed before the generic one.
+@function o-add-unicode-support-font($font, $index: false) {
+ @if $index == false {
+ $index: length($font);
+ }
+
+ $-with-support-font: ();
+ @for $i from 1 through length($font) {
+ @if $i == $index {
+ $-with-support-font: append($-with-support-font, 'Odoo Unicode Support Noto', $separator: comma);
+ }
+ $-with-support-font: append($-with-support-font, nth($font, $i), $separator: comma);
+ }
+
+ @return $-with-support-font;
+}
// Mixin which allows to extend the BS4 bg-variant mixin
@mixin o-bg-color-extension($color, $text-color, $with-muted) {}