📄 tailwindcss/docs/mask-type

File: mask-type.md | Updated: 11/15/2025

Source: https://tailwindcss.com/docs/mask-type

v4.1

⌘KCtrl KDocs Blog Showcase Sponsor Plus

  1. Effects
  2. mask-type

Effects

mask-type

Utilities for controlling how an SVG mask is interpreted.

| Class | Styles | | --- | --- | | mask-type-alpha | mask-type: alpha; | | mask-type-luminance | mask-type: luminance; |

Examples


Basic example

Use the mask-type-alpha and mask-type-luminance utilities to control the type of an SVG mask:

mask-type-alpha

mask-type-luminance

<svg>  <mask id="blob1" class="mask-type-alpha fill-gray-700/70">    <path d="..."></path>  </mask>  <image href="/img/mountains.jpg" height="100%" width="100%" mask="url(#blob1)" /></svg><svg>  <mask id="blob2" class="mask-type-luminance fill-gray-700/70">    <path d="..."></path>  </mask>  <image href="/img/mountains.jpg" height="100%" width="100%" mask="url(#blob2)" /></svg>

When using mask-type-luminance the luminance value of the SVG mask determines visibility, so sticking with grayscale colors will produce the most predictable results. With mask-alpha, the opacity of the SVG mask determines the visibility of the masked element.

Responsive design

Prefix a mask-type utility with a breakpoint variant like md: to only apply the utility at medium screen sizes and above:

<mask class="mask-type-alpha md:mask-type-luminance ...">  <!-- ... --></mask>

Learn more about using variants in the variants documentation .

On this page

[Refactoring UI

From the creators of Tailwind CSS

Make your ideas look awesome, without relying on a designer.
\

“This is the survival kit I wish I had when I started building apps.”

Derrick Reimer, SavvyCal](https://www.refactoringui.com/?ref=sidebar)

Copyright © 2025 Tailwind Labs Inc.·Trademark Policy