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

Hidden elements add outside whitespace using Space Between #3413

Closed
Vinnl opened this issue Jan 21, 2021 · 3 comments
Closed

Hidden elements add outside whitespace using Space Between #3413

Vinnl opened this issue Jan 21, 2021 · 3 comments

Comments

@Vinnl
Copy link

Vinnl commented Jan 21, 2021

Describe the problem:

When I use space-x-<nr> on an element, I'd expect that whitespace to only occur in between child elements. And generally, it does.

However, when a hidden element is present before the first element, that causes whitespace to also be added before the first element.

Link to a minimal reproduction:

https://play.tailwindcss.com/MmyASfKJ25

@adamwathan
Copy link
Member

Hey! This is a duplicate of this issue:

#3380

@Vinnl
Copy link
Author

Vinnl commented Jan 21, 2021

Oh whoops, should've searched closed issues as well. Shame it's practically impossible to fix, but that's life I guess 🤷 Thanks!

@abevoelker
Copy link

This is unfortunate. Ruby on Rails's form helpers automatically add a <input type="hidden"> CSRF token as the very first sub-element of every generated <form>, so this behavior is occurring on every form that uses these space classes.

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

No branches or pull requests

3 participants