Skip to content

Using apply when using shims, but without JS #163

Answered by sastan
srid asked this question in Q&A
Discussion options

You must be logged in to vote

You can define a plugin for this. There are two ways for static site:

  1. Using <script type="twind-config">
<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>
  1. Using setup of twind/shim
<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>

Replies: 1 comment 27 replies

Comment options

You must be logged in to vote
27 replies
@srid
Comment options

@srid
Comment options

@srid
Comment options

@sastan
Comment options

@srid
Comment options

Answer selected by srid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants