Comments on: The Power of :has() in CSS https://css-tricks.com/the-power-of-has-in-css/ Tips, Tricks, and Techniques on using Cascading Style Sheets. Thu, 02 May 2024 14:15:41 +0000 hourly 1 https://wordpress.org/?v=6.6.1 By: Luke https://css-tricks.com/the-power-of-has-in-css/#comment-1811204 Thu, 02 May 2024 14:15:41 +0000 https://css-tricks.com/?p=377635#comment-1811204 Safarie seems to have some repaint issues with complex :has selectors.

body:has(.this) .that {
  display: none;
}

doesn’t seem to work properly. If .this is removed and/or added to the DOM, .that isn’t repainted automatically. :-(

]]>
By: swim https://css-tricks.com/the-power-of-has-in-css/#comment-1809963 Tue, 16 Apr 2024 09:52:35 +0000 https://css-tricks.com/?p=377635#comment-1809963 about time. thought this website was dead. looking forward to next article in a year or two

]]>
By: Sten https://css-tricks.com/the-power-of-has-in-css/#comment-1809394 Tue, 09 Apr 2024 19:03:22 +0000 https://css-tricks.com/?p=377635#comment-1809394 Yes, it is so powerful! I made a great example to create “table column hover effect” using no javascript but :has.

It is here on codepen Modern CSS only column hover

]]>
By: Chris L https://css-tricks.com/the-power-of-has-in-css/#comment-1808253 Wed, 03 Apr 2024 17:18:23 +0000 https://css-tricks.com/?p=377635#comment-1808253 :has lets us have :focus-visible-within also, even though its not a thing.

:has(*:focus-visible)

]]>
By: Chris Zuber https://css-tricks.com/the-power-of-has-in-css/#comment-1808229 Sun, 31 Mar 2024 19:07:17 +0000 https://css-tricks.com/?p=377635#comment-1808229 Glad to see content on here again! Looks to be fairly active too.

Yep, :has() is pretty useful. And I see quite a few clever uses of it too… It’s not just a parent selector as many call it.

Also, I’ve found :is() to be useful in writing styles for a polyfill for the Popover API. Using it reduces the specificity, making any other CSS rules override what I’m giving that’s basically fulfilling the role of browser styles.

]]>
By: Oyebode Daniel https://css-tricks.com/the-power-of-has-in-css/#comment-1808226 Sat, 30 Mar 2024 14:40:54 +0000 https://css-tricks.com/?p=377635#comment-1808226 Awesome

]]>