← Tailwind CSS & Bootstrap learning path
Tailwind CSS & Bootstrap · Module 7 of 10

Responsive design and states

Use breakpoint and state prefixes in Tailwind.

📖 Key ideas

  1. Breakpoint prefixes: sm:, md:, lg:, xl:, 2xl: (mobile-first).
  2. Example: grid-cols-1 md:grid-cols-3.
  3. State variants: hover:, focus:, active:, disabled:.
  4. Dark mode: dark:bg-gray-900.
  5. Group/peer variants style children based on parents/siblings.
💡 Real-life example: Prefixes are conditions: "on medium screens and above, wear this outfit".
md:Applies from the md breakpoint up
hover:Applies on mouse hover
dark:Applies in dark mode
group-hover:Child style when parent hovered