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

[v4] Namespace override syntax is not valid CSS #15602

Open
malobre opened this issue Jan 11, 2025 Discussed in #15533 · 3 comments · May be fixed by #15603
Open

[v4] Namespace override syntax is not valid CSS #15602

malobre opened this issue Jan 11, 2025 Discussed in #15533 · 3 comments · May be fixed by #15603

Comments

@malobre
Copy link

malobre commented Jan 11, 2025

I'm using a CSS formatter (biome) that won't parse namespace overrides, e.g: --font-*, because it is not a valid ident-token according to https://drafts.csswg.org/css-syntax-3/#ident-token-diagram

I see two possibilities:

  • Keep the current syntax:
    In this case we should also support the escaped version (which is valid CSS syntax), e.g: --font-\*: initial;.
  • Change the syntax:
    The simplest alternative would be to drop the asterisk, e.g --font: initial;.
@adamwathan
Copy link
Member

Yeah I think we should support the escape syntax — removing the asterisk is ambiguous because that's how you configure suffix-less values in v4, for example:

--shadow: 0 2px 4px rgb(0 0 0 / 5%);

...can be used to configure a shadow utility (as opposed to shadow-sm or shadow-md).

@RobinMalfait RobinMalfait linked a pull request Jan 11, 2025 that will close this issue
@malobre
Copy link
Author

malobre commented Jan 11, 2025

The CSS syntax is quite limited in this context (without resorting to escaping), I guess you could have trailing dashes or underscores: --font-: initial; but it looks kinda weird.

@malobre
Copy link
Author

malobre commented Jan 11, 2025

One more thing: by having the default syntax not being valid CSS we might run into other issues like syntax highlighting acting weird etc

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 a pull request may close this issue.

2 participants