Skip to content

Commit 7f9233f

Browse files
committed
[BUGFIX] Scale default TYPO3 backend font to user agent preference
The TYPO3 backend already implicitly respects browser font size settings by using `rem` unit for some specific elements that specify explicit font sizes, but the main backend font-size (as inherited from `<body>`) still uses a fixed px unit, causing user agent font settings like "small" or "large" to be ingored, which results in a mixture of font sizes in some elements to be scaled to the user preference, while others kept at "medium". With this patch – applied only to v14 – we want to start rolling out relative units for all font sizes. There will likely be placed that require further adaption, but we believe that changing the base already provides a more harmonized experience for users with custom font size defaults. Font sizes for users with a default browser font size (e.g. "medium") are not changed. Releases: main Resolves: #104044 Resolves: #107743 Change-Id: Ie920260635ced50785a858aa307dde53fc4f3617 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/91364 Reviewed-by: Benjamin Kott <benjamin.kott@outlook.com> Reviewed-by: Benjamin Franzke <ben@bnf.dev> Tested-by: Benjamin Franzke <ben@bnf.dev> Tested-by: core-ci <typo3@b13.com> Tested-by: Benjamin Kott <benjamin.kott@outlook.com> Tested-by: Benni Mack <benni@typo3.org> Reviewed-by: Benni Mack <benni@typo3.org>
1 parent 9b3ee09 commit 7f9233f

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

Build/Sources/Sass/component/_module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
--module-docheader-bg: var(--typo3-surface-container-high);
2020
--module-docheader-border-color: color-mix(in srgb, var(--module-docheader-bg), var(--module-color) 10%);
2121
--module-docheader-border-width: 1px;
22-
--module-docheader-bar-height: 28.5px;
22+
--module-docheader-bar-height: calc((28.5px - 16px) + 1em);
2323
--module-docheader-scroll-offset: calc(-1 * (var(--module-docheader-bar-height) + var(--module-docheader-padding-y)));
2424
--module-docheader-height: calc(var(--module-docheader-bar-height) * 2 + var(--module-docheader-padding-y) * 2 + var(--module-docheader-spacing-y) + var(--module-docheader-border-width));
2525
--module-body-padding-y: 1.5rem;

Build/Sources/Sass/component/_root.scss

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,15 @@
2525
:root {
2626
color-scheme: light dark;
2727
scroll-behavior: smooth;
28+
// Respect user agent font size setting, but require at
29+
// least a minimum font-size of 14px, as we're scaling
30+
// <body> by 75% and any base font size below 14px would
31+
// become less than 10px for default text.
32+
font-size: max(1em, 14px);
2833

2934
// General
30-
--typo3-font-size: 12px;
31-
--typo3-font-size-small: 11px;
35+
--typo3-font-size: .75rem;
36+
--typo3-font-size-small: .6875rem;
3237
--typo3-font-family-sans-serif: #{$font-family-sans-serif};
3338
--typo3-font-family-monospace: #{$font-family-monospace};
3439
--typo3-font-family: var(--typo3-font-family-sans-serif);

Build/Sources/Sass/component/scaffold/_scaffold.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ body {
4949

5050
body {
5151
min-height: 100%;
52+
font-size: var(--typo3-font-size);
5253
}
5354

5455
iframe {

0 commit comments

Comments
 (0)