What are opacity utilities and how do you use them?

Beginner

Answer

Opacity utilities control the transparency of elements using a 0-100 scale:

Examples:

  • opacity-0 - Fully transparent (0%)
  • opacity-25 - 25% opacity
  • opacity-50 - 50% opacity
  • opacity-75 - 75% opacity
  • opacity-100 - Fully opaque (100%)

Color opacity:
You can also modify opacity of background colors, text colors, etc.:

  • bg-blue-500/50 - Blue background with 50% opacity
  • text-red-600/75 - Red text with 75% opacity

This is useful for overlays, disabled states, and creating depth in designs.