[Webkit-unassigned] [Bug 212522] New: CSS Clamp implementation incomplete

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri May 29 07:28:22 PDT 2020


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

            Bug ID: 212522
           Summary: CSS Clamp implementation incomplete
           Product: WebKit
           Version: Safari Technology Preview
          Hardware: Macintosh
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: CSS
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: wesbos at gmail.com

CSS clamp() function is missing two features that the rest of the browsers have implemented:


First, it does not allow for calculating the font size:

```html
  <h2>Clamp Me</h2>

  <style>
    h2 {
      font-size: clamp(30px, 20vw + 5rem, 300px);
      /* Or with calc(), which isn't needed: */
      font-size: clamp(30px, calc(20vw + 5rem), 300px);
    }
  </style>
```

This feature is needed because viewport units as font sizes are inaccessible as they do not get bigger/smaller when the user zooms in or out. 


Second, the browser doesn't repaint the size of the font when the browser is resized:

```html
  <h2>Clamp Me</h2>

  <style>
    h2 {
      font-size: clamp(30px, 20vw, 300px);
    }
  </style>
```


Resize the browser, and you'll see the font size doesn't change. Reload the page at a smaller browser width and it does resize. 


Confirmed in Release 107 (Safari 13.2, WebKit 15610.1.14.1)

-- 
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/20200529/a79f774f/attachment.htm>


More information about the webkit-unassigned mailing list