#css #frontend #html #reading-list

🔗 Sibling Selectors in TailwindCSS
twitter.com

Sibling selectors in @tailwindcss JIT: such a small section in the docs, yet so powerful 💜

https://tailwindcss.com/docs/just-in-time-mode#sibling-selector-variants

You can use this eg. to create beautiful toggle buttons powered by hidden radio inputs.

1<label>
2    <input type="radio" class="peer hidden" name="payment-method">
3    <div class="opacity-50 peer-checked:opacity-100">Visa</div>
4</label>
5
6<label>
7    <input type="radio" class="peer hidden" name="payment-method">
8    <div class="opacity-50 peer-checked:opacity-100">Mastercard</div>
9</label>
continue reading on twitter.com

⚠️ This post links to an external website. ⚠️