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

Wrong class name generated when used with TailwindCSS #73

Open
bp-pedro-rodrigues opened this issue Jan 17, 2023 · 1 comment · May be fixed by philippone/postcss-pseudo-classes#7
Open
Assignees

Comments

@bp-pedro-rodrigues
Copy link

Describe the bug
The pseudo-classes are not generated correctly when the original classname contains a :.

To Reproduce
TailwindCSS uses classnames on elements to control the styling when hover or focus, or whatever happens. The way they do this is by prefixing their regular classes with hover: or focus: or other switches.
When picking up these classes, the generated ones have an additional \. before the :. As in, if you have:

<div className="hover:text-gray-400:hover">test</div>

the class

.hover\.\:text-gray-400.\:hover

gets generated.

Expected behavior
The correct class name gets generated. In this case:

.hover\:text-gray-400.\:hover
@philippone
Copy link
Member

Hi @bp-pedro-rodrigues ,

I added the functionality to the postcss-pseudo-classes plugin to escape : additionally.

Unfortunately, the maintainer of the repo/package ignores my pull requests.
Therefore, please install my fork and test the functionality:

npm install -D https://github.com/philippone/postcss-pseudo-classes#colon-test

The expected class .hover\:text-gray-400.\:hover is now generated.

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