-
Hi, .tile {
@apply p-1 bg-blue-100 my-px;
}
.tile:hover {
@apply bg-blue-200;
} Sometimes we want to override the color, so for example: <div class="tile bg-red-100 hover:bg-red-200">
...
</div> But in this case the hover is still blue. As we want to be flexible with the colors we don't want to add classes like .tile-red, .tile-green etc. like in the example of the buttons but we stillt want to leave the default as blue. Are there some alternatives how to accomplish this? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
I believe you can put your tile definition above the utilities. That way the utilities will take precedence. @tailwind base;
@tailwind components;
.tile {
@apply p-1 bg-blue-100 my-px;
}
.tile:hover {
@apply bg-blue-200;
}
@tailwind utilities; |
Beta Was this translation helpful? Give feedback.
-
This was a misconfiguration issue. |
Beta Was this translation helpful? Give feedback.
This was a misconfiguration issue.