Git Product home page Git Product logo

tailwind-zephyr's Introduction

Tailwind Zephyr

Tools for working with TailwindCSS utility/component classes programmatically. In other words, it should make building development tooling around Tailwind a breeze.

Usage

const {
    generateComponentClasses,
    getClassPatch,
    shortcutToClass,
    siblings,
    nextSibling,
    prevSibling
} = require('tailwind-zephyr');

const cssRules = generateComponentClasses(['hover:bg-green-100', 'bg-green-300', 'border-2'], 'btn');
console.log(cssRules);
/*
`.btn {
    @apply bg-green-300 border-2
}

.btn:hover {
    @apply bg-green-100
}`
*/

const classPatch = getClassPatch(['flex', 'justify-center', 'items-start'], 'justify-start');
console.log(classPatch);
/*
{
    remove: 'justify-center',
    add: 'justify-start'
}
*/

const family = siblings('list-none');
console.log(family); // ["list-none", "list-disc", "list-decimal"]

const cclass = shortcutToClass['tp3'];
console.log(cclass); // "text-purple-300"; more shortcuts can be found in tailwind-shortcuts.json

const next = nextSibling('list-disc');
console.log(next); // "list-decimal"

const prev = prevSibling('list-none');
console.log(prev); // "list-decimal"

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.