Skip to content

[css-properties-values-api] Fallbacks for registered properties #821

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
andruud opened this issue Sep 24, 2018 · 1 comment
Closed

[css-properties-values-api] Fallbacks for registered properties #821

andruud opened this issue Sep 24, 2018 · 1 comment

Comments

@andruud
Copy link
Member

andruud commented Sep 24, 2018

Not necessarily a spec issue, I just need a clarification: do fallbacks (as specified by the var() reference) for registered properties ever trigger? E.g. can foo ever been substituted here?

--unreg: var(--reg-length, foo);

And what about:

--reg-length: 10em;
font-size: var(--reg-length, 100px);

In Blink, I've implemented the latter such that the fallback (100px) is triggered, but now I wonder if it's more consistent that var(--reg-length, 100px) is substituted with the initial/inherited value of --reg-length. I.e. the computed value of font-size becomes the initial/inherited value of --reg-length, and the computed value of --reg-length becomes 10 x initial/inherited.

@tabatkins
Copy link
Member

tabatkins commented Sep 28, 2018

Yes, registered properties can be invalid (and thus trigger fallback in var()). Properties registered with a "*" grammar and no initialValue is invalid by default, and any custom property becomes invalid if it's involved in a cyclic reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants