Skip to content

Fix odd v4 behavior with custom @-rules #1212

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 9 commits into from
Feb 17, 2025

Conversation

tizu69
Copy link
Contributor

@tizu69 tizu69 commented Feb 16, 2025

Fixes #1211

I'm not sure if the .replace I removed actually had a purpose - it seemed useless to me.
I can (probably) easily bring it back if it does have a purpose, gonna have to see how to fix it in that case hten.

Also adds a QOL feature of now autosuggesting [*] in --value(.

See the issue for way more details on why some things are the way they are.

@thecrypticace
Copy link
Contributor

The .replace is necessary but it's matching too much. I've fixed it up. Will get this merged in the am after some more testing.

@tizu69
Copy link
Contributor Author

tizu69 commented Feb 17, 2025

The .replace is necessary but it's matching too much. I've fixed it up. Will get this merged in the am after some more testing.

out of curiosity, what it is used for? I couldn't find anything that that would catch (or is supposed to catch).

@philipp-spiess
Copy link
Member

philipp-spiess commented Feb 17, 2025

@tizu69 One is for the shorthand syntax, e.g.:

@custom-variant dark (&:where(.dark, .dark *));

and one is for the syntax the block syntax:

@custom-variant dark {
  &:where(.dark, .dark *) {
    @slot;
  }
}

You can see that one regex contains the semicolon and one an opening-brace 👍

@tizu69
Copy link
Contributor Author

tizu69 commented Feb 17, 2025

ah, I see. I wasn't familiar with that first syntax, fair enough.

@thecrypticace
Copy link
Contributor

thecrypticace commented Feb 17, 2025

Also adds a QOL feature of now autosuggesting [*] in --value(.

I'm going to land this and the syntax error fix in a separate PR. I wanna get a fix out for the @custom-variant specific issue today.

@thecrypticace thecrypticace merged commit 2d473e0 into tailwindlabs:main Feb 17, 2025
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.

scuffed @custom-variant behavior
3 participants