Re: [csswg-drafts] [css-fonts-4] Feature for making text always fit the width of its parent

Yes it's feasible to implement the functionality using JS, and yes there are workarounds, and I think there even is a lib, but it sure would be very handy to be able to simply write one single line of CSS instead.

My implementation in the source if https://tobireif.com/ is more than 50 lines of JS - if people could instead write a single line of CSS then that would save a lot of typing.

By the way @litherum : If the implementation is smart enough, perhaps one pass would be sufficient → no loop / double-pass.

Perhaps the syntax could look like this:

```
fit-width: font-size(20px, 100px);
```
```
fit-width: letter-spacing(-0.1em, 1.5em);
```
```
fit-width: any-text-width-affecting-property(min, max);
```

The sizing/fitting should honour the (potential) padding of the container.

-- 
GitHub Notification of comment by tobireif
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2528#issuecomment-380711730 using your GitHub account

Received on Thursday, 12 April 2018 07:52:15 UTC