Special Text
Tailwind allows you to use modifiers to match CSS pseudo-classes for a few different types of text that you might want to treat differently.
The modifier selection applies to text that has been selected by the user, so you can apply color (selection:bg-red-400) or other styling (selection:font-bold). The selection modifier, if applied to a parent element, will be carried through to all child elements.
If you are into newspaper or magazine style effects, Tailwind offers both first-line and first-letter modifiers. This seems most applicable for size and weight, as in first-letter:text-9xl first-letter:font-bold first-line:text-2xl and so on.
Also, Tailwind allows before: and after: as modifiers for the CSS before:: and after:: pseudo-classes, ...
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