Posts Learn Components new Snippets new Categories Tags About Device Beast sponsor
/

Set TailwindCSS Utilities Important

Learn how to set TailwindCSS utilities values to important and ensure class specified on the element have more importance

Created on Jun 28, 2021

19 views

Sometimes you might come across a problem where TailwindCSS classes won't apply/take effect to an existing application's predefined classes. This is caused by CSS specificity where the order of importance is higher/more important than TailwindCSS utility classes.

To solve this the "important" option must be used which then will make sure that all of the classes will now be generated as "!important".

// tailwind.config.js

module.exports = {
  important: true,
}

Snippets by

PostSrc poster

PostSrc

Full stack developer mainly focusing on the front end side of the web. The main author of PostSrc and loves writing tutorial and guides online.

Load comments for Set TailwindCSS Utilities Important

new

PostSrc Code Components

Collection of Tailwind CSS components for everyone to use. Browse all of the components that are right for your project.

View Components

Other Code Snippets

More