W3C home > Mailing lists > Public > public-css-archive@w3.org > August 2021

Re: [csswg-drafts] [css-values] nested `calc()` is not defined by its grammar (#6506)

From: Guillaume via GitHub <sysbot+gh@w3.org>
Date: Wed, 25 Aug 2021 14:19:56 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-905543558-1629901194-sysbot+gh@w3.org>
Recently at the end of my days, the difference between what a type of value (literally) is vs. what a type of value represents, often becomes blurry to me. :zany_face:

> This shows that it’s talking about values rather than tokens, obviously leaving it open for non-literals.

I currently believe that a `<number>` is a component value that represent a number. A component value is either one of the preverved tokens (which include `<number-token>`), a function, or a block.

My struggle was more related to missing the quoted definition below, which means to me that a CSS type representing a numeric (CSS component) value, ie. a `<number-token>`, a `<dimension-token>`, or a `<percentage-token>`, can be replaced (alternatively parsed with the grammar of) a math function, and [I learned last week](https://github.com/w3c/csswg-drafts/issues/2921#issuecomment-901219411) that a math function (a component value that is a function) that replaces a `<number>`, is itself a `<number>`:

> A math function represents a numeric value [...] and can be used wherever such a value would be valid.

I'm not very used to reading technical specs and english is not my native language, so please take it as my very humble opinion: isn't `attr()` defined as a type that can replace a property value when a `<string>` is expected, ie. it can not replace a function argument that expects a `<string>`?

> The `attr()` function substitutes the value of an attribute on an element into a property, similar to how the `var()` function substitutes a custom property value into a function.

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

Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 25 August 2021 14:19:58 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:42 UTC