1.0.5 • Published 3 years ago

@twind/preact v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

@twind/preact Latest Release MIT License

Twind integration for Preact which allows to use the tw property, css property and className (shim without shim).

Installation

npm install @twind/preact

Usage

Edit twind-preact

You must call setup during the app initialization.

import { setup } from '@twind/preact'

// Must call
setup({
  // Optional define props to use
  props: {
    // tw: false, // to disable
    // css: false, // to disable
    // className: true, // to enable
  },
  /* other twind configuration options */
})

const App = () => (
  <main
    tw="h-screen bg-purple-400 flex items-center justify-center"
    css={
      {
        /* CSS Object */
      }
    }
  >
    <h1 tw="font-bold text(center 5xl white sm:gray-800 md:pink-700)">This is Twind!</h1>
  </main>
)

Shim-like usage but without the shim

Edit twind-shim-preact

import { setup } from '@twind/preact'

setup({
  props: {
    // tw: false, // to disable
    // css: false, // to disable
    className: true, // to enable – suppports `class` property as well
  },
  /* other twind configuration options */
})

const App = () => (
  <main className="h-screen bg-purple-400 flex items-center justify-center">
    <h1 class="font-bold text(center 5xl white sm:gray-800 md:pink-700)">This is Twind!</h1>
  </main>
)

Styled API

Coming soon! In the mean time try @twind/react with aliasing React to Preact

License

MIT

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago