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

Introduce :user-valid & :user-invalid variants #12370

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MartijnCuppens
Copy link
Contributor

@MartijnCuppens
Copy link
Contributor Author

It looks like the pseudo elements are not yet added to https://github.com/cssnano/cssnano/blob/master/packages/postcss-merge-rules/src/lib/ensureCompatibility.js, because they are part of the Selectors Level 4 spec. Should I unmerge the rules in the test for now or should we wait for this feature to land until support is added in postcss-merge-rules?

@RobinMalfait RobinMalfait changed the base branch from master to archive/master-2024-02-23 March 4, 2024 21:48
@RobinMalfait RobinMalfait changed the base branch from archive/master-2024-02-23 to next April 17, 2024 21:36
@RobinMalfait
Copy link
Member

Hey!

You might have noticed that I forced pushed to this branch. The reason is because the PR now uses next as the base branch which is our working branch for Tailwind CSS v4. In other words, the feature you implemented here is now written in the new codebase.

The code is ported as-is, so no API changes of your feature happened while moving it to the new codebase.

I also made sure to add you as a co-author because you still deserve all the credit 💪

@Ionys320
Copy link

Hi @RobinMalfait! Is it possible to have it in v3, or it will only be available in v4?

@Kashi-Datum
Copy link

Any updates / timeline on this? Looking forward to these inputs!

@jstoparczyk
Copy link

Hi @RobinMalfait! Is it possible to have it in v3, or it will only be available in v4?

Yes, you can use arbitrary properties: [&:user-invalid]:

@MartijnCuppens
Copy link
Contributor Author

(just rebased this PR)

moufmouf added a commit to workadventure/design-system that referenced this pull request Sep 25, 2024
We use "custom" pseudo-element while waiting for Tailwind support:
tailwindlabs/tailwindcss#12370
moufmouf added a commit to workadventure/design-system that referenced this pull request Sep 25, 2024
We use "custom" pseudo-element while waiting for Tailwind support:
tailwindlabs/tailwindcss#12370
@KieraDOG
Copy link

KieraDOG commented Oct 28, 2024

Hi @RobinMalfait! Is it possible to have it in v3, or it will only be available in v4?

Yes, you can use arbitrary properties: [&:user-invalid]:

peer-[&:user-invalid] trying to use with peer to display an error message, but it is not working

       <Input 
          placeholder="Enter staging access token" 
          autoComplete="off" 
          className="peer [&:user-invalid]:border-red-500"
          required 
        />
        <div className="mt-1 text-red-500 invisible peer-[&:user-invalid]:visible">
          The filed is required
        </div>

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

Successfully merging this pull request may close these issues.

6 participants