Loading tutorials
Intermediate · Mid: 14 chapters · 34 min read. States assumed prerequisites
Start reading:hover and :focus. It also assumes you have used Tailwind utilities such as colors, padding, and rounded corners in a project where Tailwind is already set up.:hover pseudo-class. It also assumes you can use common Tailwind utilities such as colors, padding, and rounded corners in a project that already has Tailwind set up.:focus, :focus-visible, and :focus-within pseudo-classes, and that Tailwind is already set up in your project. It covers three focus variants, when each one applies, and the mistakes people make with them.:active and :disabled pseudo-classes. It also assumes you have used Tailwind utilities for colors and padding, and that Tailwind is already set up in your project. You should also know the hover: prefix from the previous chapters.hover: and focus-visible: variants. Here you add motion to those state changes.focus: and focus-visible: variants from the previous chapter. It also assumes you can read basic Tailwind utilities. The examples use Tailwind CSS v4.hover: work and that you can write basic Tailwind utilities. A variant makes a utility apply only in a given state. Here you will extend that idea so a parent's state can change its children.group and group-hover: work, and that you are comfortable with focus, focus-visible, and focus-within. Here you extend the same pattern to other states, so that a parent can react to keyboard focus, and not only to the mouse.hover: and focus: variants, and the basic group and group-hover: pattern. You also need a project where Tailwind CSS is already set up.group-hover: works, can read basic HTML and CSS, and have a Tailwind project set up. The group variant styles children from a parent. The peer variant solves a different problem: styling an element based on the state of a sibling that comes before it.hover: and focus: variants from earlier chapters, and that you have Tailwind set up with dark mode available.hover:, group-hover: and focus-within: from earlier chapters. It also assumes you know basic CSS media queries.hover:, group-hover:, peer-invalid:) and the way variants stack. It also assumes Tailwind v3.1 or later.