Giter Site home page Giter Site logo

node-tailwindo's Introduction

Tailwindo

javascript version of https://github.com/awssat/tailwindo

This tool can convert Boostrap CSS classes in HTML code to equivalent Tailwind CSS classes, still not perfect but good as a helper tool.

http://riazxrazor.in/bootstrap-to-tailwind

Installing tailwindo for CLI use

Requires nodejs version >= 10

You can install the package via npm globally:

$ npm i -g tailwindo

Then use it to convert a snippet, a file or a folder.

Using the command

Possible Options

Convert a directory (just the files in this directory, it's not recursive)
$ tailwindo path/to/directory/ 
Recursively convert a directory
$ tailwindo path/to/directory/ --recursive=true

You can also use the short hand -r true instead of the full --recursive=true

Convert different file extensions

This will allow you to upgrade your vue files, twig files, and more!

$ tailwindo path/to/directory/ --extensions=vue,php,html

You can also use the short hand -e vue,php,html instead of the full --extensions

Overwrite the original files

Please note this can be considered a destructive action as it will replace the orignal file and will not leave a copy of the original any where.

$ tailwindo path/to/directory/ -p
Convert raw code

just CSS classes:

$ tailwindo 'alert alert-info'

Or html:

$ tailwindo '<div class=\"alert alert-info mb-2 mt-3\">hi</div>'

Convert a file

By default this will copy the code into a new file like file.html -> file.tw.html

$ tailwindo file.blade.php

This option works with the -p option

Using the package

You can install the package via npm locally in your project folder:

$ npm i tailwindo
Usage: tailwindo <path/to/directory/>
Options:
  --version         Show version number                                [boolean]
  -r, --recursive   Recursively convert a directory                    [boolean]
  -e, --extensions  Convert different file extensions                   [string]
  -p, --replace     Overwrite the original files                       [boolean]
  -?, --help        Show help                                          [boolean]

By Riaz Ali Laskar

Then use it like this:

const tailwindo = require('tailwindo');

$input = '<div class="alert alert-danger">hi</div>'; //BootstrapCSS code

$output = tailwindo($input) // gets converted code

License

The MIT License (MIT). Please see License File for more information.

node-tailwindo's People

Contributors

riazxrazor 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.