Earlier quoted context omitted.
I believe it's regular old css. The :has() pseudo class. https://developer.mozilla.org/en-US/docs/Web/CSS/:has
It's not even :has, it's just how child selectors in CSS have always worked. // Not actually needed, here // for competition .group {} // Child selector .group:hover group\/hover\:bg-black { background-color: black; } // Which is essentially the same as .group:hover child { background-color: black; }
Vanilla JavaScript support for Tailwind Plus
131–140 of 202 posts
Re: Vanilla JavaScript support for Tailwind Plus
#132Earlier quoted context omitted.
It's not even :has, it's just how child selectors in CSS have always worked. // Not actually needed, here // for competition .group {} // Child selector .group:hover group\/hover\:bg-black { background-color: black; } // Which is essentially the same as .group:hover child { background-color: black; }
That doesn't affect the parent (.group) based on the child though.
Re: Vanilla JavaScript support for Tailwind Plus
#133Earlier quoted context omitted.
Yes I agree - it's nice to be able to see exactly what's happening without needing to dive into a rats nest of fragile CSS cascades.
This is literally a rats nest of css cascades.
Re: Vanilla JavaScript support for Tailwind Plus
#134Re: Vanilla JavaScript support for Tailwind Plus
#135Earlier quoted context omitted.
It's not even :has, it's just how child selectors in CSS have always worked. // Not actually needed, here // for competition .group {} // Child selector .group:hover group\/hover\:bg-black { background-color: black; } // Which is essentially the same as .group:hover child { background-color: black; }
Isn’t it funny that in a thread about how Tailwind is bad and people should learn real css… people also think css selectors require JS?
Re: Vanilla JavaScript support for Tailwind Plus
#136Earlier quoted context omitted.
It's not even :has, it's just how child selectors in CSS have always worked. // Not actually needed, here // for competition .group {} // Child selector .group:hover group\/hover\:bg-black { background-color: black; } // Which is essentially the same as .group:hover child { background-color: black; }
That doesn't affect the parent (.group) based on the child though.
I don't think Tailwind has a built-in `:has` tool, but I suspect it would be easy to add one as a custom class.
Re: Vanilla JavaScript support for Tailwind Plus
#137Looks like it's done using standards-based web components[0]. The page says these components don't require any existing JavaScript framework; because web component support is built-in to the browser. Nice to see devs picking up web components. [0]: https://developer.mozilla.org/en-US/docs/Web/API/Web_compone...
12 years I’ve been saying this… 12, damn, years. React graduates look at me crazy. Angular devs say it’s not needed anyway. Svelte bros say get bent. I’m so happy that someone is paying attention. You don’t need a shadow dom, you don’t need rerendering of everything when a simple value changes. You simply need web components and scoped js/ts with vite or whatever rollup you use.
Re: Vanilla JavaScript support for Tailwind Plus
#138Lovely. Verbosity aside, now on top of knowing CSS you need to learn another hierarchical system within class names.
Re: Vanilla JavaScript support for Tailwind Plus
#139Lovely. Verbosity aside, now on top of knowing CSS you need to learn another hierarchical system within class names.
Oh yeah, when I open a typical big project with Tailwind I always love to see some: Team Settings Manage your team permissions, invites, roles, and integrations here. Changes apply instantly across all team workspaces. Cancel Save Changes
Re: Vanilla JavaScript support for Tailwind Plus
#140Lovely. Verbosity aside, now on top of knowing CSS you need to learn another hierarchical system within class names.
I just can't fathom how someone can look at this and think "yeahhhh thats some good clean code". How did tailwind get so popular? Learn plain CSS. It's really good now
Because most of those classes are per component.
If you have a single card component defined with these classes, and then repeat it 20 times on the page, then of course the output will look like a giant mess.
> How did tailwind get so popular?
- quick to understand and get started with
- much cleaner for components than the variety of CSS-in-JS libs
- (mostly) do not require fighting CSS with BEM-style atrocities
- come with nice default styles and colors that can be easily changed and extended
> Learn plain CSS. It's really good now
CSS is okay now. We only just got nesting and scoping