- From: Tab Atkins Jr. via GitHub <sysbot+gh@w3.org>
- Date: Mon, 14 Oct 2024 20:02:40 +0000
- To: public-css-archive@w3.org
tabatkins has just created a new issue for https://github.com/w3c/csswg-drafts: == [css-values-5] attr()'s "px"/etc keywords == In <https://github.com/w3c/csswg-drafts/issues/10437#issuecomment-2377634442> we resolved to change `attr()`'s type argument from [a bespoke list of keywords](https://drafts.csswg.org/css-values-5/#typedef-attr-type) to the newly-minted "CSS grammar in CSS" syntax. Most of the existing attr() type keywords translate over just fine (usually just wrapping them in `<>` characters), but the unit names don't. That is, under the current spec you can write `width: attr(foo px)`, and given an element like `<div foo=500>`, it'll be parsed as a number and then be assumed to be a `px` value. There's no way to express this sort of behavior in CSS grammar, tho. Note that this is basically just a convenience; one could instead write `calc(1px * attr(foo <number>))` and get the same result. So the *use-case* is covered no matter what. Do we want to try and allow this, tho? The issue is that bare keywords already have meaning in the `<css-syntax>` production (they represent those keywords, same as in any other CSS grammar), so it would be somewhat awkward to mix them in. I propose that we just drop that functionality, and let `calc()` cover the issue of "interpret a number as a particular unit". Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/11034 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Monday, 14 October 2024 20:02:41 UTC