[Webkit-unassigned] [Bug 250350] New: CSS smart minimum font size breaks sites that use the "font-size: 6.25%" trick for 1:1 rem/px correspondence

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jan 9 18:01:36 PST 2023


https://bugs.webkit.org/show_bug.cgi?id=250350

            Bug ID: 250350
           Summary: CSS smart minimum font size breaks sites that use the
                    "font-size: 6.25%" trick for 1:1 rem/px correspondence
           Product: WebKit
           Version: Safari 16
          Hardware: Mac (Apple Silicon)
                OS: macOS 13
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: CSS
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: saagar at saagarjha.com

Many sites use some variation of

:root {
        font-size: 6.25%;
}

to get some semblance of 1:1 conversion between rem and px units, since most browsers will use 16px for the default font size. However, WebKit has a "smart minimum" (https://github.com/WebKit/WebKit/blob/7f27a00f1eb14a39e730336e96b639d852d322f3/Source/WebCore/style/StyleFontSizeFunctions.cpp#L53) font size that kicks in to try to avoid font sizes that are too small. Explicit pixel values (e.g. 1px) do not trigger this, but 6.25% (which presumably is supposed to scale with the user's accessibility settings) gets scaled up to 9px and this breaks those sites. Perhaps it would be worthwhile not triggering this behavior on the root element?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20230110/f9787dbd/attachment.htm>


More information about the webkit-unassigned mailing list