From e537728dd1e09360201cbfad4836f1a2ddcfc26b Mon Sep 17 00:00:00 2001 From: Marco Ambrosini Date: Wed, 31 Jul 2024 14:36:23 +0200 Subject: [PATCH] Feat: update line height Since we have different font sizes, we should make the line height dependent on the font size and not a fixed value. The recommended value for accessibility is 1.5. https://www.w3.org/WAI/WCAG21/Understanding/text-spacing.html Signed-off-by: Marco Ambrosini --- apps/theming/css/default.css | 2 +- apps/theming/lib/Themes/DefaultTheme.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/theming/css/default.css b/apps/theming/css/default.css index 63633da9511ab..c742f05fba013 100644 --- a/apps/theming/css/default.css +++ b/apps/theming/css/default.css @@ -50,7 +50,7 @@ --font-face: system-ui, -apple-system, 'Segoe UI', Roboto, Oxygen-Sans, Cantarell, Ubuntu, 'Helvetica Neue', 'Noto Sans', 'Liberation Sans', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'; --default-font-size: 15px; /* 1.5 x font-size for accessibility */ - --default-line-height: 24px; + --default-line-height: 1.5; --animation-quick: 100ms; --animation-slow: 300ms; /** Border width for input elements such as text fields and selects */ diff --git a/apps/theming/lib/Themes/DefaultTheme.php b/apps/theming/lib/Themes/DefaultTheme.php index 9c093969e766a..47f9904207d7b 100644 --- a/apps/theming/lib/Themes/DefaultTheme.php +++ b/apps/theming/lib/Themes/DefaultTheme.php @@ -161,7 +161,7 @@ public function getCSSVariables(): array { '--font-face' => "system-ui, -apple-system, 'Segoe UI', Roboto, Oxygen-Sans, Cantarell, Ubuntu, 'Helvetica Neue', 'Noto Sans', 'Liberation Sans', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'", '--default-font-size' => '15px', // 1.5 * font-size for accessibility - '--default-line-height' => '24px', + '--default-line-height' => '1.5', // TODO: support "(prefers-reduced-motion)" '--animation-quick' => '100ms',