Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

twind

Package Overview
Dependencies
Maintainers
2
Versions
159
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

twind

tailwindcss compat based on twind

  • 1.0.0-next.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7.9K
decreased by-14.66%
Maintainers
2
Weekly downloads
 
Created
Source

twind


READ THIS FIRST!

Twind v1 is still in beta. Expect bugs!

Twind v1 is a complete rewrite aiming to be compatible with Tailwind v3 classes


Tailwind right in the browser without any build step.

CDN Usage

Add this line to your index.html:

<script src="https://cdn.jsdelivr.net/npm/twind@next"></script>

To configure Twind (optional):

<script>
  twind.setup({
    presets: [
      // custom presets...
    ],
    theme: {
      extend: {
        colors: {
          clifford: '#da373d',
        },
      },
    },
    rules: [
      // custom rules...
    ],
    // ...
  })
</script>

By default, @twind/autoprefix and @twind/preset-tailwind will be applied.

Try it live

CDN Builds

Core

Without any preset:

<script src="https://cdn.jsdelivr.net/npm/twind@next/core.global.js"></script>
Tailwind

With @twind/autoprefix and @twind/preset-tailwind:

<script src="https://cdn.jsdelivr.net/npm/twind@next"></script>
Mini

With @twind/autoprefix and @twind/preset-mini:

<script src="https://cdn.jsdelivr.net/npm/twind@next/mini.global.js"></script>

Bundler Usage

npm i twind
import { setup } from 'twind'

setup({
  /* options */
})

API

Everything from @twind/core is available.

setup

Can be called as many times as you want.

cx (from @twind/core)

import { cx } from 'twind'

// Set a className
element.className = cx`
  underline
  /* multi
    line
    comment
  */
  hover:focus:!{
    sm:{italic why}
    lg:-{px}
    -mx-1
  }
  // Position
  !top-1 !-bottom-2
  text-{xl black}
`

tw

TDB

apply

TDB

theme

TDB

Keywords

FAQs

Package last updated on 09 Jan 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc