All Projects → sibbng → variantwind

sibbng / variantwind

Licence: MIT license
Most elegant way to work with TailwindCSS variants in Vue

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to variantwind

tailwind-color-alpha
Automatic alpha variants for your Tailwind CSS colors based on your opacity config
Stars: ✭ 21 (-53.33%)
Mutual labels:  tailwind, tailwindcss, tailwindcss-plugin
react-tailwind
This is a complementary React code for the tailwindcss project.
Stars: ✭ 29 (-35.56%)
Mutual labels:  tailwind, tailwindcss, tailwindcss-plugin
windstrap
Tailwind CSS with Bootstrap JS
Stars: ✭ 63 (+40%)
Mutual labels:  tailwind, tailwindcss-plugin, tailwind-plugin
stencil-tailwind-plugin
Plugin for using tailwindcss with StencilJS
Stars: ✭ 17 (-62.22%)
Mutual labels:  tailwind, tailwindcss
intellij-tailwind-css
Tailwind IntelliJ Plugin Tailwind Cheat Sheet
Stars: ✭ 49 (+8.89%)
Mutual labels:  tailwindcss, tailwindcss-plugin
vuejs-tailwindcss-portfolio
A simple multipage and responsive Vue.js & Tailwind CSS portfolio theme with dark mode.
Stars: ✭ 100 (+122.22%)
Mutual labels:  tailwind, tailwindcss
taro-plugin-tailwind
Taro 接入 windicss / tailwindcss 插件
Stars: ✭ 78 (+73.33%)
Mutual labels:  tailwind, tailwindcss
Limg
An image hosting service powered by Laravel
Stars: ✭ 41 (-8.89%)
Mutual labels:  tailwind, tailwindcss
create-next-pwa
⚡️ Set up Next.js Progressive Web App with `npx create-next-pwa`
Stars: ✭ 59 (+31.11%)
Mutual labels:  tailwind, tailwindcss
material-tailwind
@material-tailwind is an easy-to-use components library for Tailwind CSS and Material Design.
Stars: ✭ 861 (+1813.33%)
Mutual labels:  tailwind, tailwindcss
twin.examples
Packed with examples for different frameworks, this repo helps you get started with twin a whole lot faster.
Stars: ✭ 320 (+611.11%)
Mutual labels:  tailwind, tailwindcss
svelte-tailwind-snowpack
TailwindCSS with Svelte and Snowpack v3
Stars: ✭ 100 (+122.22%)
Mutual labels:  tailwind, tailwindcss
shopify-foundation-theme
Modern Shopify theme using Shopify Theme Lab, Liquid, Vue and Tailwind CSS 🎨
Stars: ✭ 195 (+333.33%)
Mutual labels:  tailwind, tailwindcss
vscode-xwind
vscode extension for xwind
Stars: ✭ 16 (-64.44%)
Mutual labels:  tailwind, tailwindcss
nuxt3-app
Nuxt3 (Nuxt 3) best starter repo, Tailwindcss, Sass, Headless UI, Vue, Pinia, Vite
Stars: ✭ 252 (+460%)
Mutual labels:  tailwindcss, vue3
kickstart
Ruby on Rails application templates
Stars: ✭ 61 (+35.56%)
Mutual labels:  tailwind, tailwindcss
tailwind-twitter-clone
Twitter UI Clone built during a live stream.
Stars: ✭ 19 (-57.78%)
Mutual labels:  tailwind, tailwindcss
eslint-plugin-tailwind
ESLint rules for Tailwind CSS
Stars: ✭ 97 (+115.56%)
Mutual labels:  tailwind, tailwindcss
vite-vue3-tailwind
Boilerplate at vue 3 whit firebase, vue notus, typesctip, vite, tailwind
Stars: ✭ 21 (-53.33%)
Mutual labels:  tailwind, vue3
tailwindcss-fluid-type
A plugin that makes the use of Fluid Type a breeze.
Stars: ✭ 91 (+102.22%)
Mutual labels:  tailwind, tailwindcss

variantwind

Most elegant way to work with TailwindCSS variants in Vue

Use as directive or binding, supports both Vue 2 & 3, also supports PurgeCSS🔥🔥

Installation

yarn add variantwind # or `npm i variantwind`

CDN

<script src"https://unpkg.com/variantwind"></script>

Usage

import { createApp } from "vue";
import App from "./App.vue";
import Variantwind from "variantwind";

const app = createApp(App);

/**
 * Directives:  v-variantwind
 * Methods:     $variantwind
 */
app.use(Variantwind, "variantwind");

/* ===== OR =====*/

/**
 * Directives:  v-variantwind v-dark
 * Methods:     $variantwind $dark
 *
 * Note: This plugin doesn't provide dark mode functionality. This is just a use case example.
 */
app.use(Variantwind, ["variantwind", "dark"]);

app.mount("#app");
<template>
  <div
    class="w-full bg-red-500 md:{w-1/3 bg-blue-500} lg:{w-1/4 bg-yellow-500 hover:bg-yellow-900}"
    v-variantwind
  >
    Middleware
  </div>

  <div
    v-variantwind="'w-full bg-red-500 md:{w-1/3 bg-blue-500} lg:{w-1/4 bg-yellow-500 hover:bg-yellow-900}'"
  >
    Directive binding
  </div>

  <div
    v-variantwind="'w-full bg-red-500 md:{w-1/3 bg-blue-500} lg:{w-1/4 bg-yellow-500 hover:bg-yellow-900}'"
    v-dark="'dark:{bg-black-900 text-white}'"
  >
    Multiple directives
  </div>

  <div
    :class="variantwind('lg:{w-1/4 bg-yellow-500 hover:bg-yellow-900}')"
    :class="$variantwind('lg:{w-1/4 bg-yellow-500 hover:bg-yellow-900}')"
  >
    Local and Global Class binding
  </div>

  <div
    class="w-full bg-red-500 md:{w-1/3 bg-blue-500}"
    :class="$variantwind('lg:{w-1/4 bg-green-500 hover:bg-green-900}')"
    v-variantwind="'xl:{w-1/4 bg-yellow-500 hover:bg-yellow-900}'"
    v-dark="'dark:{bg-black-900 text-white}'"
  >
    You can use all of them together.
  </div>
</template>

<script>
  import { variantwind } from "variantwind";

  export default {
    // Pass function to template for local class binding usage
    methods: { variantwind },
  };
</script>

TailwindCSS Purge

// tailwind.config.js
const { extractor } = require("variantwind");

module.exports = {
  purge: {
    content: ["./index.html", "./src/**/*.vue", "./src/**/*.js"],
    options: {
      extractors: [
        {
          extractor,
          extensions: ["vue"],
        },
      ],
    },
  },
};

License

MIT License © 2020 sibbng

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].