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-syntax-3] Restrict validity of substitution values and math functions #8717

Closed
cdoublev opened this issue Apr 14, 2023 · 4 comments
Closed

Comments

@cdoublev
Copy link
Collaborator

In Chrome/FF, calc(100% / 3) {} is an invalid CSS keyframe.

However in CSS Syntax:

CSS Values 4 § 2 Value Definition Syntax defines how to specify a grammar for properties. This section extends those definitions to also allow specifying a grammar for rules.

Substitution values (attr(), mix(), random-*(), toggle()) and math functions may have to be restricted here.

In my opinion, substitution values should be invalid, except as a declaration value for a feature query in @supports, and math functions should only be valid in a declaration value.

Related: #7838.

@tabatkins
Copy link
Member

Substitution values (attr(), mix(), random-*(), toggle()) and math functions may have to be restricted here.

All of the "substitution values" are invalid by virtue of only being defined in the context of a property on an element.

Math functions are resolveable anywhere, tho. If we don't want to allow them, that's possible, we just need to define the rule grammar accordingly, for example to use <percentage-token> rather than <percentage>.

@cdoublev
Copy link
Collaborator Author

All of the "substitution values" are invalid by virtue of only being defined in the context of a property on an element.

It is clear to me. I was thinking of the author who would like to understand why they are invalid outside of this context. But ok.

Math functions are resolveable anywhere

Actually, I was more interested in this clarification. So they can be a valid keyframe selector? (If so, this issue can be closed.) Or should a keyframe selector be defined with <percentage-token>?

@tabatkins
Copy link
Member

So they can be a valid keyframe selector? (If so, this issue can be closed.) Or should a keyframe selector be defined with ?

Probably the latter, just due to compat.

@cdoublev
Copy link
Collaborator Author

cdoublev commented Apr 18, 2023

Ok. I will open a dedicated issue later. Maybe calculations can be usefull for #4907, and I find it hard to understand compatibility requirements, sometimes.

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

No branches or pull requests

2 participants