[Bug Report]: The .hidden class does not cascade throughout all devices #1918
-
Tailwindcss version: ^1.4.6 Acording to the documentation in the responsive design section:
Steps to reproduce the bug: PS:. As i could not find an issue template, i did my best to describe the problem. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
Can you share the exact snippet of HTML where you are seeing this problem? This is probably a misunderstanding. As you can see here, it does hide things at all sizes: It will only stop hiding the element if you've added another class that unhides it, like Tailwind's responsive classes are mobile-first, so |
Beta Was this translation helpful? Give feedback.
-
Here's the code: I even posted it on stack overflow when i was thinking the the problem was with the browser. You can check it here Browser not updating after remove or add a class in HTML element Probably i'm missing something... |
Beta Was this translation helpful? Give feedback.
-
Yep so you have Your code says "hide this element until the The CSS is: .hidden {
display: none;
}
@media (min-width: 768px) {
.md\:grid {
display: grid;
}
} What are you actually trying to accomplish? Do you want it to be visible as a grid or do you want it to be hidden? Are you trying to dynamically toggle whether it is hidden or visible using JS? |
Beta Was this translation helpful? Give feedback.
-
Sorry for wasting your time with this. I'm trying to toggle it using JS. I have already a solution in mind. |
Beta Was this translation helpful? Give feedback.
-
The solution is pretty simple, i just had to wrap the fom inside a div and toogle it with JS. <div class=" hidden">
<form action="" class="p-5 w-full md:grid md:grid-cols-3 md:gap-4">
some thing here
</form>
</div> Thanks @adamwathan 🎉 ! |
Beta Was this translation helpful? Give feedback.
The solution is pretty simple, i just had to wrap the fom inside a div and toogle it with JS.
Thanks @adamwathan 🎉 !