Created
May 21, 2026 12:41
-
-
Save joeldrapper/486316c0523fdccccf2bb22d889c5dd2 to your computer and use it in GitHub Desktop.
Display contents container query workaround for Safari
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Safari bug: https://bugs.webkit.org/show_bug.cgi?id=301871 | |
| Re-declaring a property forces container query re-evaluation. */ | |
| @utility contents { | |
| display: contents; | |
| --contents-cache-key: 0; | |
| &:has(:hover) { | |
| --contents-cache-key: 0; | |
| } | |
| &:has(:focus) { | |
| --contents-cache-key: 0; | |
| } | |
| &:has(:focus-visible) { | |
| --contents-cache-key: 0; | |
| } | |
| &:has(:focus-within) { | |
| --contents-cache-key: 0; | |
| } | |
| &:has(:active) { | |
| --contents-cache-key: 0; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment