Re: [csswg-drafts] [css-variables-2] Custom units as simple variable desugaring (#7379)

To expand just a little on [@scottkellum’s post](https://github.com/w3c/csswg-drafts/issues/7379#issuecomment-1170335569), I was wondering if we could utilize a ‘nesting’ unit for math, similar to how we might utilize a [nesting selector](https://www.w3.org/TR/css-nesting-1/#nest-selector) for rules.

- This would be a unit for a new `<dimension>`.
- The specific naming of the unit — `var`, `n`, `whatever` — is bike-shedding.
- Outside Custom Units, it would resolve to a unit-less `<number>`.
  - e.g. `--step: calc(1rem / .25n)` would be equivalent to `--step: calc(1rem / .25)`.
- Within Custom Units, it would resolve to the multiple of its own number and the Custom Unit’s number.
  - e.g. `12--step` would be equivalent to `calc(1rem / (.25 * 12))`.

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


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 29 June 2022 18:49:30 UTC