Tailwind CSS and data attributes
This commit is contained in:
parent
32cc453505
commit
dfee30e5e9
5 changed files with 139 additions and 0 deletions
13
tailwindcss/data-attributes.html
Normal file
13
tailwindcss/data-attributes.html
Normal file
|
@ -0,0 +1,13 @@
|
|||
<link href="/tailwind.css" rel="stylesheet" />
|
||||
|
||||
<div class="p-10 flex gap-4">
|
||||
<div class="size-30 bg-red-500"></div>
|
||||
|
||||
<!-- Styling based on a data attribute on the element. -->
|
||||
<div class="size-30 bg-red-500 data-[theme=blue]:bg-blue-500" data-theme="blue"></div>
|
||||
|
||||
<!-- Styling based on a data attribute on a parent element. -->
|
||||
<div class="group" data-theme="banana">
|
||||
<div class="size-30 bg-red-500 group-data-[theme=banana]:bg-yellow-500"></div>
|
||||
</div>
|
||||
</div>
|
Loading…
Add table
Add a link
Reference in a new issue