Skip to content

Instantly share code, notes, and snippets.

@ImanMahmoudinasab
Last active May 31, 2024 00:15
Show Gist options
  • Save ImanMahmoudinasab/b9ce87780bc52d41767b1001587edd2b to your computer and use it in GitHub Desktop.
Save ImanMahmoudinasab/b9ce87780bc52d41767b1001587edd2b to your computer and use it in GitHub Desktop.
Tailwind missing manual

CSS Variables

Set a css variable
<div class="[--var:0]" ></div>
Set a css variable and make it !important
<div class="[--var:0_!important]" ></div>

:not() selectors

an element that is not last child
<div class="[&:not(:last-child)]:p-2" ></div>
an element that doesn't have attribute data-open
<div class="TODO" ></div>
an element that doesn't have a child with attribute data-orientation = vertical
<div class="[&:not(:has(>[data-orientation='vertical']))]:p-2" ></div>

:has() selectors

an element that has a child with attribute data-orientation = vertical
<div class="has-[>[data-orientation='vertical']]:p-2" ></div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment