-
I have a static site project that doesn't really use JS (except where strictly necessary), and I'm using the twind shim during development because it is a no fuss way to get tailwind working (during production static generation I might use The shim works on element classes, however if I want to create an unique style like the following, how can I make it work when using twind/shim? <style>
.btn {
@apply bg-purple-200 p-3 border-2 hover:border-4 hover:opacity-50;
}
</style> twind/shim currently ignores the style tags. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 27 replies
-
You can define a plugin for this. There are two ways for static site:
<script type="module" src="https://cdn.skypack.dev/twind/shim"></script>
<script type="twind-config">
{
"plugins": {
"btn": "bg-purple-200 p-3 border-2 hover:border-4 hover:opacity-50"
}
}
</script>
<button class="btn">Click me</button>
<script type="module">
import { setup } from "https://cdn.skypack.dev/twind/shim"
setup({
plugins: {
btn: "bg-purple-200 p-3 border-2 hover:border-4 hover:opacity-50"
}
})
</script>
<button class="btn">Click me</button> |
Beta Was this translation helpful? Give feedback.
You can define a plugin for this. There are two ways for static site:
<script type="twind-config">