Add both !important & selector strategy for tailwind configuration

Built-in important modifier

You can make any utility important by adding a ! character to the beginning:

<button class="!bg-green-500">Hello</button>

Output

.\!bg-green-500 {
    --tw-bg-opacity: 1 !important;
    background-color: rgb(34 197 94 / var(--tw-bg-opacity)) !important
}

https://tailwindcss.com/docs/configuration#important-modifier

Leave a Comment