Git Product home page Git Product logo

twind's Introduction

The smallest, fastest, most feature complete Tailwind-in-JS solution in existence


MIT License Latest Release Documentation Github Discord CI Coverage Status

Twind is a small compiler that converts utility classes into CSS at runtime. The goal of this project is to unify the flexibility of CSS-in-JS with the carefully considered constraints of the Tailwind API.

Utility-first CSS without any build step right in the browser or any other environment like Node.js, deno, workers, ...


Nov 18, 2022: Twind v1 is now in stable release!

Check out the Migration Guide to upgrade or go to the v0.16 branch.


โœจ Features

โšก๏ธ No build step

Get all the benefits of Tailwind without the need for Tailwind, PostCSS, configuration, purging, or autoprefixing.

๐Ÿš€ Framework agnostic

If your app uses HTML and JavaScript, it should work with Twind. This goes for server-rendered apps too.

๐Ÿ˜Ž One low fixed cost

Twind ships the compiler, not the CSS. This means unlimited styles and variants for one low fixed cost.

Other features
  • ๐ŸŒŽ No bundler required: Usable via CDN
  • ๐ŸŽจ Seamless integration with Tailwind
  • ๐Ÿค Feature parity with Tailwind v3
  • ๐ŸŽฏ Extended variants, rules, and syntax
  • ๐Ÿš“ Escape hatch for arbitrary CSS
  • ๐Ÿค– Built in support for conditional rule combining
  • ๐Ÿง Improved readability with multiline styles and comments
  • โ„๏ธ Optional hashing of class names ensuring no conflicts
  • ๐Ÿ”ฉ Flexible: configurable theme, rules and variants
  • ๐Ÿ”Œ Language extension via presets
  • ๐ŸŽฉ No runtime overhead with static extraction
  • ๐Ÿš… Faster than most CSS-in-JS libraries
  • โšก Fully tree shakeable: Only take what you want
  • ๐Ÿฆพ Type Strong: Written in Typescript
  • and more!

๐Ÿ“– Documentation

The full documentation is available at twind.style.

๐Ÿ’ฌ Community

For help, discussion about best practices, or any other conversation that would benefit from being searchable use Github Discussions.

To ask questions and discuss with other Twind users in real time use Discord Chat.

๐Ÿงฑ Contribute

See the Contributing Guide for information on how to contribute to this project.

๐ŸŒธ Credits

๐Ÿ’ก Inspiration

It would be untrue to suggest that the design here is totally original. Other than the founders' initial attempts at implementing such a module (oceanwind and beamwind) we are truly standing on the shoulders of giants.

  • Tailwind CSS: created a wonderfully thought out API on which the compiler's grammar was defined.
  • styled-components: implemented and popularized the advantages of doing CSS-in-JS.
  • htm: a JSX compiler that proved there is merit in doing runtime compilation of DSLs like JSX.
  • goober: an impossibly small yet efficient CSS-in-JS implementation that defines critical module features.
  • otion: the first CSS-in-JS solution specifically oriented around handling CSS in an atomic fashion.
  • clsx: a tiny utility for constructing class name strings conditionally.
  • style-vendorizer: essential CSS prefixing helpers in less than 1KB of JavaScript.
  • UnoCSS: for the configuration syntax.
  • CSSType: providing autocompletion and type checking for CSS properties and values.

๐Ÿค Contributors

Thank you to all the people who have already contributed to twind!

๐Ÿ™๐Ÿพ Sponsors

This project is kindly sponsored by Kenoxa GmbH who support @sastan to maintain this project as part of their open-source engagement.

COPILOT TRAVEL is partnering with @sastan to keep twind aligned with the latest Tailwind CSS releases.

Thank you to all our sponsors!

Sponsors

Please ask your company to also support this open source project by becoming a sponsor on opencollective or GitHub.

โš–๏ธ License

The MIT license governs your use of Twind.

twind's People

Contributors

danielduel avatar danielweck avatar github-actions[bot] avatar ignusg avatar itsmapleleaf avatar javascriptjedi avatar nexxeln avatar nonissue avatar pi0 avatar renhiyama avatar rschristian avatar sastan avatar sebilasse avatar sergeizheleznov avatar thecmdrunner avatar tranquilmarmot avatar wommy avatar wzulfikar avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.