- From: Tab Atkins Jr. via GitHub <noreply@w3.org>
- Date: Mon, 06 Apr 2026 22:56:53 +0000
- To: public-css-archive@w3.org
Yeah, the proposal in the discussion vaguely landed on `parse()` and `compute()`, for parsing strings and tokens, respectively.
I'm thinking:
* `parse()` would take a string and an [`<attr-type>`](https://drafts.csswg.org/css-values-5/#typedef-attr-type), and parse it like attr(). Probably take a fallback too, in case parsing fails.
* `compute()` would take a [`<css-type>`](https://drafts.csswg.org/css-mixins/#typedef-css-type) and some tokens, and parse it like a custom property registration. Also taking a fallback, in case parsing fails.
That is, `parse(<length> "5em")` would act identically to `attr(foo <length>)` (with `foo="5em"`), and `compute(<length> 5em)` would act identically to `--as-length(5em)` (with `@function --as-length(--x <length>){ result: var(--x); }`)
So `parse(number counter(...))` would indeed convert a counter value into an integer.
--
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12488#issuecomment-4195454483 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Monday, 6 April 2026 22:56:54 UTC