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-values] Make slashes implicitly omissible like commas #7200

Closed
SebastianZ opened this issue Apr 5, 2022 · 4 comments
Closed

[css-values] Make slashes implicitly omissible like commas #7200

SebastianZ opened this issue Apr 5, 2022 · 4 comments

Comments

@SebastianZ
Copy link
Contributor

For commas in values there is a definition that says that they are implicitly omissible when

  • all items preceding the comma have been omitted
  • all items following the comma have been omitted
  • multiple commas would be adjacent (ignoring white space/comments), due to the items between the commas being omitted.

I believe the same logic should apply to slashes within values.

One explicit case for that is currently discussed in #7142.

Sebastian

@tabatkins
Copy link
Member

No, this is impossible - the slash is absolutely required in several properties already to avoid ambiguity. In particular, 'font' requires it to distinguish a font-size from a line-height, and 'border-image' requires it to distinguish all four of its longhand components.

@SebastianZ
Copy link
Contributor Author

This change wouldn't touch existing syntaxes because they don't allow leading or trailing slashes nor multiple subsequent slashes without values in between them.

font requires <'font-size'> to be set at the left side of the slash and <'line-height'> on the right side. border-image requires either <'border-image-source'> or <'border-image-slice'> on the left and <'border-image-width'> and <'border-image-outset'> on the right side.
I.e. in those cases the slash is required and the rules mentioned above do not apply.

Sebastian

@tabatkins
Copy link
Member

Nope, border-image allows syntax like 0 // 0 (slice and outset specified, width unspecified between them), which would run afoul of the "two commas next to each other" rule.

I misremembered 'font' - the font-size is indeed always required, so the / <'line-height'> wouldn't run afoul of these rules.

Regardless, tho, border-image has an irreconcilable conflict.

@SebastianZ
Copy link
Contributor Author

Oh, you're right. 😞 I misinterpreted the syntax of border-image and didn't realize that 0 // 0 is valid.

Though the main point why I came up with this idea was to avoid leading or trailing slashes in values. I'll open a related issue to discuss that.

Sebastian

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