- From: Tommy Hodgins via GitHub <sysbot+gh@w3.org>
- Date: Sat, 14 Apr 2018 17:44:42 +0000
- To: public-css-archive@w3.org
Here's the definition of `ew`, `eh`, `emin`, and `emax` from [jsincss-element-units](https://github.com/tomhodgins/jsincss-element-units):
```js
switch(unit) {
  case 'ew':
    return tag.offsetWidth / 100 * number + 'px'
  case 'eh':
    return tag.offsetHeight / 100 * number + 'px'
  case 'emin':
    return Math.min(tag.offsetWidth, tag.offsetHeight) / 100 * number + 'px'
  case 'emax':
    return Math.max(tag.offsetWidth, tag.offsetHeight) / 100 * number + 'px'
}
```
I was thinking of isolating just these tests into their own package (and maybe the element query tests from jsincss-element-query) so other plugin builders could more easily re-use the same tests in their plugins.
-- 
GitHub Notification of comment by tomhodgins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2528#issuecomment-381346886 using your GitHub account
Received on Saturday, 14 April 2018 17:44:45 UTC