Closed
Description
There is something I believe it shouldn't behave like this
I made a component called .form-control
in a separate file, when applying focus properties like this, every single property takes !important
flag:
@layer components {
.form-control {
@apply py-2 px-4 block w-full rounded-md border border-gray-300 shadow-sm focus:outline-none focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50;
}
}
This applied to focus state as well:
- It's important to know that this is happening only if I set important to
true
intailwind.config.js
. - And when I remove
focus:*
properties everything working well.
Currently, I'm rolling back to the old way and it's working perfectly.
@layer components {
.form-control {
@apply py-2 px-4 block w-full rounded-md border border-gray-300 shadow-sm;
}
.form-control:focus {
@apply outline-none border-indigo-300 ring ring-indigo-200 ring-opacity-50
}
}
Have I misunderstood something or this is a bug?
Link to a minimal reproduction:
https://github.com/themustafaomar/tailwind-v2-apply-is-weird
Metadata
Metadata
Assignees
Labels
No labels