Skip to content

[css-values-5] How to determine the type of in calc-mix()? #10770

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
cdoublev opened this issue Aug 23, 2024 · 2 comments
Closed

[css-values-5] How to determine the type of in calc-mix()? #10770

cdoublev opened this issue Aug 23, 2024 · 2 comments

Comments

@cdoublev
Copy link
Collaborator

cdoublev commented Aug 23, 2024

The type of calc-mix() must be made consistent with the type of its , which is defined with:

= [ | | <'animation-timeline'>] && [by ]?

What is the type of in these examples?

  1. calc-mix(0%, 1px, 2px) in a context
  2. calc-mix(calc(0%), 1px, 2px) in a context
  3. calc-mix(--timeline, 1px, 2px)

My respective guesses:

  1. [percentage → 1]
  2. [percentage → 1]
  3. []

In my opinion, the type of calc(0%) matching should always be [percentage → 1], whatever the "higher" context is.

@cdoublev
Copy link
Collaborator Author

cdoublev commented Sep 6, 2024

Sorry, I missed that should actually have been replaced with in the production rule, as explained in the detailed definition appearing below the production rule:

[...]

Note: This only allows literal percentages, like 15%; calculations like calc(100% / 7) will not work [...].

But this restriction seems to be motivated solely by internal constraints that authors would not understand it, imo.

Would it not be possible to say that always resolves to [percentage → 1] as a term of a math function replacing ?

cdoublev added a commit to cdoublev/css that referenced this issue Sep 11, 2024
- the type of <'animation-timeline'> for  must be []
- the type of  for  must be [percentage → 1]
- the type of  in math functions for  must be [percentage → 1]
- the type of  in progress() must always be based on the closest context
- the type of  calculations do not need to be made consistent with
  its 

w3c/csswg-drafts#10770
@cdoublev
Copy link
Collaborator Author

This issue is no longer valid after the change in 5fbd75b.

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

1 participant