GithubHelp home page GithubHelp logo

kongmoumou / vite-plugin-windicss Goto Github PK

View Code? Open in Web Editor NEW

This project forked from windicss/vite-plugin-windicss

0.0 1.0 0.0 1.97 MB

๐Ÿƒ Windi CSS for Vite โšก๏ธ

License: MIT License

TypeScript 100.00%

vite-plugin-windicss's Introduction

vite-plugin-windicss

Windi CSS for Vite, it's fast! โšก๏ธ

Features

  • โšก๏ธ It's FAST - 20~100x times faster than Tailwind on Vite
  • ๐Ÿงฉ On-demand CSS utilities (Fully compatible with Tailwind CSS v2)
  • ๐Ÿ“ฆ On-demand native elements style reseting (preflight)
  • ๐Ÿ”ฅ Hot module replacement (HMR)
  • ๐Ÿƒ Load configurations from tailwind.config.js
  • ๐Ÿค Framework-agnostic - Vue, React, Svelte and vanilla!
  • ๐Ÿ“„ CSS @apply / @screen directives transforms (also works for Vue SFC's <style>)
  • ๐ŸŽณ Support Variant Groups - e.g. bg-gray-200 hover:(bg-gray-100 text-red-300)
  • ๐Ÿ˜Ž "Design in Devtools" - if you work this way in the traditional Tailwind, no reason we can't!

Documentation

Read the documentation for more details.

New Features in v3.0

Enabled it by

// windi.config.ts
export default {
  attributify: true
}

And use them as you would like:

<button 
  bg="blue-400 hover:blue-500 dark:blue-500 dark:hover:blue-600"
  text="sm white"
  font="mono light"
  p="y-2 x-4"
  border="2 rounded blue-200"
>
  Button
</button>

Prefix

If you are concerned about naming confliction, you can add custom prefix to attributify mode by:

// windi.config.ts
export default {
  attributify: {
    prefix: 'w:'
  }
}
<button 
  w:bg="blue-400 hover:blue-500 dark:blue-500 dark:hover:blue-600"
  w:text="sm white"
  w:font="mono light"
  w:p="y-2 x-4"
  w:border="2 rounded blue-200"
>
  Button
</button>
// windi.config.ts
export default {
  alias: {
    'hstack': 'flex items-center',
    'vstack': 'flex flex-col',
    'icon': 'w-6 h-6 fill-current',
    'app': 'text-red',
    'app-border': 'border-gray-200 dark:border-dark-300',
  },
}

Sponsors

License

MIT License ยฉ 2021 Anthony Fu

vite-plugin-windicss's People

Contributors

antfu avatar hannoeru avatar harlan-zw avatar elmassimo avatar alexanderniebuhr avatar jserwang avatar schelmo avatar innocenzi avatar aleclarson avatar szolowicz avatar charlesokwuagwu avatar dominikg avatar yyx990803 avatar hrishikesh-k avatar wheatjs avatar ydcjeff avatar marob avatar sujit-baniya avatar tmkx avatar anncwb avatar yoglib avatar zakcutner avatar agoni1212 avatar kukac7 avatar bhvngt avatar high1 avatar pull-vert avatar reslear avatar zhcode-fun avatar

Watchers

James Cloos 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.