Variant Modifiers
We’ve seen variant modifiers in Tailwind like hover and focus, but Tailwind defines a couple dozen modifiers, and the command-line tool only generates the CSS for modifier combinations you actually use.
In addition to the screen size modifiers sm, md, lg, xl, and 2xl, following is a partial tour of the Tailwind modifiers:
-
active: Applies when the element is active.
-
dark: Applies if Tailwind thinks it’s in dark mode.
-
first-letter: Applies to the first letter of the text.
-
first-line: Applies to the first line of the text.
-
hover: Applies when the user is hovering the pointer over the element.
-
landscape: Applies if the device is in landscape orientation.
-
ltr: Applies for text going left to right.
-
marker: Applies to the list marker. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access