Re: [csswg-drafts] [css-grid][css-sizing] Aspect Ratio

> That wouldn't be how an ew unit works in real CSS though.

It could be spec'd to work just as in EQCSS.

> I think if ew was used on the width property it would equate to the same as if you used %.

```
@element .select-any-element-here-not-necessarily-the-parent and (max-width: 422px) {
  /*
  Inside this block, the element-width unit "ew" is based on the selected element.
  It can be any element.
  */
}
```

This is a later example from above:
```
@element #foo {
  #foo {
    height: 100ew;
  }
}
```

> This is a unit that should be usable anywhere like the vw unit, not just on grid items.

Yes, sure!

Perhaps you want to open a new ticket for the ew unit? (there's isn't one yet)

> Imagine how great it would be to be able to write font-size: 20ew,. Now you can have text that scales with the size of its container rather than the size of the viewport! (font-size: 20vw;)

In
https://tobireif.com/demos/grid/
https://tobireif.com/demos/grid/view_demo_source/ 
there is for example `font-size: 57ew;`.

But even better for that type of use case would be to be able to say "always fit this line of text in this container (by adjusting property foo eg font-size or letter-spacing), no matter what font is used".

Related: https://github.com/w3c/csswg-drafts/issues/2528

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

Received on Wednesday, 22 August 2018 10:28:16 UTC