4 ms·
https://developer.mozilla.org/en-US/docs/Web/CSS/Subsequent-sibling_combinator https://developer.mozilla.org/en-US/docs/Web/CSS/Subsequent-...
by gmaster1440 2y ago
https://developer.mozilla.org/en-US/docs/Web/CSS/Subsequent-sibling_combinator https://developer.mozilla.org/en-US/docs/Web/CSS/Subsequent-...
- ezekg 2y agoI'm still not following the limitation. You can use ~ in place of + in my example and it'll work for subsequent siblings too, not just for next sibling.
- gmaster1440 2y agoCan you share a snippet or link to a repl showing how I can use `peer-` to make the label below have a gray text color when the input sibling is disabled? ``` <label for="email">Email</label> <input disabled id="email" type="email" /> ```
- ezekg 2y agoI don't use Tailwind but this is easy with CSS: label:has(+ input:disabled) { color: gray; } Not sure why Tailwind couldn't do this.
- gmaster1440 2y agoAh, I see. May simply be the case then that `:has()` is relatively new and it wasn't possible prior to it's general availability as recent as Dec 2023.