- Published
Brightness - Tailwind docs example
- Authors
- Name
- Tailwind Labs Team
Basic usage
Changing element brightness
Use the brightness-{amount?}
utilities to control an element's brightness.
_72<div_72 class="flex scroll-p-8 justify-start overflow-scroll sm:block sm:overflow-visible"_72>_72 <div_72 class="flex shrink-0 items-center justify-around gap-6 p-8 font-mono font-bold sm:gap-4"_72 >_72 <div class="flex shrink-0 flex-col items-center">_72 <p_72 class="mb-3 text-center font-mono text-sm font-medium text-slate-500 dark:text-slate-400"_72 >_72 brightness-50_72 </p>_72 <div class="relative brightness-50">_72 <img_72 class="h-24 w-24 rounded-lg object-cover shadow-xl"_72 src="https://images.unsplash.com/photo-1554629947-334ff61d85dc?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=320&h=320&q=80"_72 />_72 <div_72 class="absolute inset-0 rounded-lg ring-1 ring-inset ring-black/10"_72 ></div>_72 </div>_72 </div>_72 <div class="flex shrink-0 flex-col items-center">_72 <p_72 class="mb-3 text-center font-mono text-sm font-medium text-slate-500 dark:text-slate-400"_72 >_72 brightness-100_72 </p>_72 <div class="relative brightness-100">_72 <img_72 class="h-24 w-24 rounded-lg object-cover shadow-xl"_72 src="https://images.unsplash.com/photo-1554629947-334ff61d85dc?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=320&h=320&q=80"_72 />_72 <div_72 class="absolute inset-0 rounded-lg ring-1 ring-inset ring-black/10"_72 ></div>_72 </div>_72 </div>_72 <div class="flex shrink-0 flex-col items-center">_72 <p_72 class="mb-3 text-center font-mono text-sm font-medium text-slate-500 dark:text-slate-400"_72 >_72 brightness-125_72 </p>_72 <div class="relative brightness-125">_72 <img_72 class="h-24 w-24 rounded-lg object-cover shadow-xl"_72 src="https://images.unsplash.com/photo-1554629947-334ff61d85dc?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=320&h=320&q=80"_72 />_72 <div_72 class="absolute inset-0 rounded-lg ring-1 ring-inset ring-black/10"_72 ></div>_72 </div>_72 </div>_72 <div class="flex shrink-0 flex-col items-center">_72 <p_72 class="mb-3 text-center font-mono text-sm font-medium text-slate-500 dark:text-slate-400"_72 >_72 brightness-200_72 </p>_72 <div class="relative brightness-200">_72 <img_72 class="h-24 w-24 rounded-lg object-cover shadow-xl"_72 src="https://images.unsplash.com/photo-1554629947-334ff61d85dc?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=320&h=320&q=80"_72 />_72 <div_72 class="absolute inset-0 rounded-lg ring-1 ring-inset ring-black/10"_72 ></div>_72 </div>_72 </div>_72 </div>_72</div>
Removing filters
Applying conditionally
Hover, focus, and other states
Breakpoints and media queries
Using custom values
Customizing your theme
By default, Tailwind includes a handful of general purpose brightness
utilities. You can customize these values by editing theme.brightness
or theme.extend.brightness
in your tailwind.config.js
file.
Learn more about customizing the default theme in the theme customization documentation.