Skip to content
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

[css-anchor-position] anchor() Fallback type inconsistency vs WPT #10831

Open
dshin-moz opened this issue Sep 3, 2024 · 4 comments
Open

[css-anchor-position] anchor() Fallback type inconsistency vs WPT #10831

dshin-moz opened this issue Sep 3, 2024 · 4 comments

Comments

@dshin-moz
Copy link

For the anchor() function's optional fallback value, the spec text specifies <length-percentage>, but the corresponding WPT, anchor-parse-valid.html, considers the use of anchor() function itself to be valid, seemingly contradicting the spec text.

It seems to me that both the spec and the test were initially committed this way - Which one is correct?

@emilio
Copy link
Collaborator

emilio commented Sep 5, 2024

The spec seems clear, unless there's a strong cause to allow anchor() in the fallback?

cc @tabatkins @fantasai

@dshin-moz
Copy link
Author

Also the case for anchor-size() - Fallback on spec is <length-percentage>, but WPT allows anchor-size().

@bfgeek
Copy link

bfgeek commented Sep 9, 2024

So the fallback is somewhat desirable IMO, e.g. you can chain things together like:

right: anchor(--a left, anchor(--b left))

e.g. if "a" doesn't exist, use "b".

Note this is different than something like:
min(anchor(--a left), anchor(--b left)) as this will resolve the unknowns to zero, having an affect on the result.

@dshin-moz
Copy link
Author

Hm, probably can draw an analogy to var() allowing multiple fallbacks through nesting..

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