Utilities for applying blur filters to an element.
Use the blur-{amount?}
utilities alongside the filter
utility to blur an element.
<div class="filter blur-lg ...">
<!-- ... -->
</div>
To control an element’s blur at a specific breakpoint, add a {screen}:
prefix to any existing blur utility. For example, use md:blur-lg
to apply the blur-lg
utility at only medium screen sizes and above.
<div class="filter blur-sm md:blur-lg ...">
<!-- ... -->
</div>
For more information about Tailwind’s responsive design features, check out the Responsive Design documentation.
You can customize which blur
utilities are generated using the blur
key in the theme
section of your tailwind.config.js
file.
// tailwind.config.js
module.exports = {
theme: {
+ extend: {
+ blur: {
+ xs: '2px',
+ }
+ }
}
}
Learn more about customizing the default theme in the theme customization documentation.
By default, only responsive variants are generated for blur utilities.
You can control which variants are generated for the blur utilities by modifying the blur
property in the variants
section of your tailwind.config.js
file.
For example, this config will also generate hover and focus variants:
// tailwind.config.js
module.exports = {
variants: {
extend: {
// ...
+ blur: ['hover', 'focus'],
}
}
}
If you don't plan to use the blur utilities in your project, you can disable them entirely by setting the blur
property to false
in the corePlugins
section of your config file:
// tailwind.config.js
module.exports = {
corePlugins: {
// ...
+ blur: false,
}
}