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

Re: [csswg-drafts] [css-values-4] inherit() function: like var() for parent value, for any property (#2864)

From: Oriol Brufau via GitHub <sysbot+gh@w3.org>
Date: Mon, 18 Jan 2021 13:56:49 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-762266752-1610978208-sysbot+gh@w3.org>
> Does it return the parent value regardless of what it is, or walk up ancestors until it finds a value or hit the root?

In general I don't think walking ancestors makes much sense for non-inherited properties. Even for inherited ones it may be undesirable. So I would just return the parent value.

> It should probably have a fallback, just like `var()`. The fallback would apply when the returned value is `initial`.

But using the fallback for initial values would be inconsistent with `var()` and `env()`. I think the fallback should be used when the serialization of the computed value is the empty string (like a guaranteed-invalid value, or a shorthand that can't represent the values of its longhands). IMO custom behaviors for specific values should be achieved with conditionals (#5624).

> Can shorthands be referenced? If so, what do they return?

If this feature is based on serializations, then it doesn't seem problematic to me. Just try to serialize the shorthand, and return that in case of success, or empty string otherwise. When reparsed, empty string can be treated as a guaranteed-invalid value, and use the fallback value if provided, or become IACVT otherwise.

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


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Monday, 18 January 2021 13:56:51 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 19 October 2021 01:31:38 UTC