Skip to content

[css-mixins-1] Use the <syntax> Production for param types #10496

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

Merged
merged 2 commits into from
Jun 26, 2024

Conversation

andruud
Copy link
Member

@andruud andruud commented Jun 25, 2024

No description provided.

@andruud andruud requested review from mirisuzanne and tabatkins June 25, 2024 23:09
@andruud
Copy link
Member Author

andruud commented Jun 25, 2024

This is an "optional add-on" to the first css-mixins-1 text which makes typed parameters a lot less noisy (--f type("<length>") vs --f <length>). Please have a look.

It should probably eventually go into either css-properties-values-api or css-values, though.

Copy link
Contributor

@mirisuzanne mirisuzanne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me generally. Left a couple comments/questions.


<div class='example'>
<pre class='lang-css'>
red | &lt;color&gt;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the order important for this example? I don't think it should be, but not sure if we need to clarify that.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The order matters when the thing using the syntax definition (and the values produced using that syntax definition) wants to act differently on identifiers vs colors. For example, a registered custom property with "red | <color>" would compute red to red, but blue to rgb(0, 0, 255).

For custom functions I don't think it actually matters, but I wrote this section with the intent to eventually move it somewhere more general.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense.

Co-authored-by: Miriam Suzanne <miriam@oddbird.net>
@mirisuzanne mirisuzanne merged commit 826a192 into w3c:main Jun 26, 2024
1 check passed
@andruud andruud deleted the syntax_def_02 branch June 26, 2024 20:24
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

Successfully merging this pull request may close these issues.

2 participants