From d77319989f9d4702d6a63cce5562a3d646640a54 Mon Sep 17 00:00:00 2001 From: "Adrien Minne (adrm)" Date: Wed, 1 Mar 2023 14:10:53 +0000 Subject: [PATCH] [IMP] spreadsheet: inherit font family MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now `spreadsheet` inherits the font family from its parent in the DOM. Odoo task 3000885 closes odoo/o-spreadsheet#2247 X-original-commit: 93900b4222f1180200bf4aa4cf9997dd88d22871 Signed-off-by: RĂ©mi Rahir (rar) Signed-off-by: Minne Adrien (adrm) --- demo/main.css | 2 ++ src/components/composer/composer/composer.ts | 3 ++- src/components/figures/chart/scorecard/chart_scorecard.ts | 1 + src/components/spreadsheet/spreadsheet.ts | 3 --- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/demo/main.css b/demo/main.css index 34a99705ee..c6c8e98f6a 100644 --- a/demo/main.css +++ b/demo/main.css @@ -8,6 +8,8 @@ html { body { height: 100%; margin: 0px; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Ubuntu, + "Noto Sans", Arial, sans-serif !important; } .o-spreadsheet { width: 100%; diff --git a/src/components/composer/composer/composer.ts b/src/components/composer/composer/composer.ts index 71cc9487c9..87e1504e58 100644 --- a/src/components/composer/composer/composer.ts +++ b/src/components/composer/composer/composer.ts @@ -1,5 +1,5 @@ import { Component, onMounted, onPatched, onWillUnmount, useRef, useState } from "@odoo/owl"; -import { NEWLINE } from "../../../constants"; +import { DEFAULT_FONT, NEWLINE } from "../../../constants"; import { EnrichedToken } from "../../../formulas/index"; import { functionRegistry } from "../../../functions/index"; import { @@ -63,6 +63,7 @@ css/* scss */ ` padding-right: 2px; box-sizing: border-box; + font-family: ${DEFAULT_FONT}; caret-color: black; padding-left: 3px; diff --git a/src/components/figures/chart/scorecard/chart_scorecard.ts b/src/components/figures/chart/scorecard/chart_scorecard.ts index 895e41da69..dc4b7864ed 100644 --- a/src/components/figures/chart/scorecard/chart_scorecard.ts +++ b/src/components/figures/chart/scorecard/chart_scorecard.ts @@ -26,6 +26,7 @@ const LINE_HEIGHT = 1.2; css/* scss */ ` div.o-scorecard { + font-family: ${DEFAULT_FONT}; user-select: none; background-color: white; display: flex; diff --git a/src/components/spreadsheet/spreadsheet.ts b/src/components/spreadsheet/spreadsheet.ts index f3a0601cc8..27fd7dcfef 100644 --- a/src/components/spreadsheet/spreadsheet.ts +++ b/src/components/spreadsheet/spreadsheet.ts @@ -55,9 +55,6 @@ css/* scss */ ` color: #333; } - * { - font-family: "Roboto", "RobotoDraft", Helvetica, Arial, sans-serif; - } &, *, *:before,