Skip to content

freekmurze/termwind

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

165 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Termwind logo

Termwind

TailCli example

GitHub Workflow Status (master) Total Downloads Latest Version License


Termwind allows you to build unique and beautiful PHP command-line applications, using the Tailwind CSS API. In short, it's like Tailwind CSS, but for the PHP command-line applications.

Installation & Usage

Requires PHP 8.0+

Require Termwind using Composer:

composer require nunomaduro/termwind

Get Started

use function Termwind\{render};

// single line html
render('<div class="p-2 text-color-white bg-blue">Hello World</div>');

// multi-line html
render(<<<'HTML'
    <div class="p-2 text-color-white bg-blue">
        <a class="ml-2">foo</a>
        <a class="ml-2" href="https://nunomaduro.com">nunomaduro.com</a>
    </div>
HTML);

// Symfony / Laravel console commands
use function Termwind\{render};

class UsersAllCommand extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'users:all';

    /**
     * Execute the console command.
     *
     * @return int
     */
    public function handle()
    {
        render(
            view('users.index', [
                'users' => User::all()
            ])
        );
    }
}

style()

The style() function may be used to add own custom syles.

use function Termwind\{style, span};

style('btn')->apply('p-4 bg-blue text-color-white');

render('<div class="btn">Click me </div>');

Termwind is an open-sourced software licensed under the MIT license.

About

๐Ÿƒ In short, it's like Tailwind CSS, but for the PHP command-line applications.

Resources

License

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • PHP 100.0%