This package wraps up the standalone executable version of the Tailwind CSS framework for a Laravel application.

Overview

Tailwind CSS for Laravel

Total Downloads Latest Stable Version License

Introduction

This package wraps the standalone Tailwind CSS CLI tool. No Node.js required.

Inspiration

This package was inspired by the Tailwind CSS for Rails gem.

Installation

You can install the package via composer:

composer require tonysm/tailwindcss-laravel

Optionally, you can publish the config file with:

php artisan vendor:publish --tag="tailwindcss-config"

Usage

The package consists of 4 commands and a helper function.

Download the Tailwind CSS Standalone Binary

Since each OS/CPU needs its own version of the compiled binary, the first thing you need to do is run the download command:

php artisan tailwindcss:download

This will detect the correct version based on your OS and CPU architecture.

By default, it will place the binary at the root of your app. The binary will be called tailwindcss. You may want to add that line to your project's .gitignore file.

Alternatively, you may configure the location of this binary file in the config/tailwindcss.php (make sure you export the config file if you want to do that).

Installing the Scaffolding

There are some files needed for the setup to work. On a fresh Laravel application, you may run the install command, like so:

php artisan tailwindcss:install

This will ensure there's a tailwind.config.js file at the root of your project, as well as a resources/css/app.css file with the basic Tailwind CSS setup.

Building

To build the Tailwind CSS styles, you may use the build command:

php artisan tailwindcss:build

By default, that will read your resources/css/app.css file and generate the compiled CSS file at public/css/app.css.

You may want to generate the final CSS file with a digest on the file name for cache busting reasons (ideal for production). You may do so with the --digest flag:

php artisan tailwindcss:build --digest

You may also want to generate a minified version of the final CSS file (ideal for production). You may do so with the --minify flag:

php artisan tailwindcss:build --minify

These two flags will make the ideal production combo. Alternatively, you may prefer using a single --prod flag instead, which is essentially the same thing, but shorter:

php artisan tailwindcss:build --prod

Watching For File Changes

When developing locally, it's handy to run the watch command, which will keep an eye on your local files and run a build again whenever you make a change locally:

php artisan tailwindcss:watch

Note: the watch command is not meant to be used in combination with --digest or --minify flags.

Using the Compiled Asset

To use the compiled asset, you may use the tailwindcss helper function instead of the mix function like so:

- <link rel="stylesheet" href="{{ mix('css/app.css') }}" >
+ <link rel="stylesheet" href="{{ tailwindcss('css/app.css') }}" >

That should be all you need.

Deploying Your App

When deploying the app, make sure you add the ideal build combo to your deploy script:

php artisan tailwindcss:build --prod

If you're running on a "fresh" app (or an isolated environment, like Vapor), and you have added the binary to your .gitignore file, make sure you also add the download command to your deploy script before the build one. In these environments, your deploy script should have these two lines

php artisan tailwindcss:download
php artisan tailwindcss:build --prod

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

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

Comments
Releases(0.8.0)
  • 0.8.0(Nov 17, 2022)

    Changelog

    • NEW: The tailwindcss() function throws an exception when the manifest file is missing. When testing, we don't want that behavior as we don't always need to compile our styles to run the tests (sometimes we do). For that reason, you may now use the new InteractsWithTailwind trait and call the $this->withoutTailwind() method on your tests (or in the base TestCase) to disable the missing manifest exception on your tests (see docs). Initial work by @andreasnij (thanks!)
    Source code(tar.gz)
    Source code(zip)
  • 0.7.0(Aug 6, 2022)

    Changelog

    • Bumps default Tailwind CLI version to 3.1.8 (https://github.com/tonysm/tailwindcss-laravel/commit/575332c3710d8a1a9beda423740c458ede68402c)
    Source code(tar.gz)
    Source code(zip)
  • 0.6.0(Jul 3, 2022)

    Changelog

    • CHANGED: The tailwindcss:install command was changed to work with the new frontend setup in Laravel 9, which uses Vite instead of Mix. It should also keep working on installs in Laravel apps using Mix. Of course, it also works on apps using neither (*cough* *cough* Importmap Laravel)
    Source code(tar.gz)
    Source code(zip)
  • 0.5.1(Jun 27, 2022)

    Changelog

    • Bumps default Tailwind CLI version to 3.1.4 (https://github.com/tonysm/tailwindcss-laravel/commit/a853d4a436d58a554e3cb0e2f878935884dac342)
    Source code(tar.gz)
    Source code(zip)
  • 0.5.0(Jun 27, 2022)

    Changelog

    • Changes default scaffolding from using @tailwind to using @import (https://github.com/tonysm/tailwindcss-laravel/commit/bcc0b9d09cdb375cad59020c670c05b51dae01fa)
    Source code(tar.gz)
    Source code(zip)
  • 0.4.1(May 1, 2022)

    Changelog

    • FIXED: Set the working directory explicitly to base_path() by @mucenica-bogdan https://github.com/tonysm/tailwindcss-laravel/pull/12
    Source code(tar.gz)
    Source code(zip)
  • 0.4.0(Apr 12, 2022)

    Changelog

    • Adds a TAILWINDCSS_CLI_VERSION envvar to allow overriding it without publishing the config file
    • Bumps the default CLI version to v3.0.24
    • Adds a new --cli-version option to the tailwindcss:install and tailwindcss:download commands which may be used by passing the --cli-version="v3.0.24"
    Source code(tar.gz)
    Source code(zip)
  • 0.3.0(Feb 13, 2022)

    Changelog

    • CHANGED: the tailwindcss.php config was updated: instead of specifying the destination file path, you define a destination PATH, we'll construct the full file path based on the source file relative path.
    • CHANGED: The binary destination file in the tailwindcss.php now checks if the file destination should end with .exe or not (for Windows support)
    • FIXED: the tailwindcss:download and tailwindcss:build commands now are working on Windows machines.
    • NEW: Increase tailwindcss:download default timeout when downloading the binary and allow users overriding it with the --timeout flag (accepts seconds)

    If you have published the config, please, republish it again (no need to publish it if you haven't done that yet)

    Source code(tar.gz)
    Source code(zip)
  • 0.2.0(Feb 13, 2022)

  • 0.1.0(Feb 9, 2022)

  • 0.0.3(Feb 4, 2022)

    Changelog

    • FIXED: the option got renamed from --production to --prod right before pushing and there were some places still referencing it. That's fixed (https://github.com/tonysm/tailwindcss-laravel/commit/4d8861597442babdd727541d2dcec1bf0ba42f61)
    Source code(tar.gz)
    Source code(zip)
  • 0.0.2(Feb 4, 2022)

    Changelog

    • NEW: There's now a new --prod option for the tailwindcss:build command, which combines the --digest and --minify flags (https://github.com/tonysm/tailwindcss-laravel/commit/7fb3609211437df0243c8d72a9de177c9dd4054f)
    Source code(tar.gz)
    Source code(zip)
Owner
Tony Messias
Tony Messias
Twitter clone project being developed by using PHP Laravel Framework and tailwind.css

Twits! About Twits! We, as enthusiastic learners and new developers, kicked of this project in order to improve our skills and capabilities in PhP Lar

Furkan Meraloğlu 10 Aug 29, 2022
Lavacharts is a graphing / charting library for PHP 5.4+ that wraps Google's Javascript Chart API.

Lavacharts 3.1.12 Lavacharts is a graphing / chart library for PHP5.4+ that wraps the Google Chart API. Stable: Dev: Developer Note Please don't be di

Kevin Hill 616 Dec 17, 2022
A TALL (Tailwind CSS, Alpine.js, Laravel and Livewire) Preset for Laravel

Laravel TALL Preset A front-end preset for Laravel to scaffold an application using the TALL stack, jumpstarting your application's development. If yo

Laravel Frontend Presets 1.8k Jan 7, 2023
Nebula is a minimalistic and easy to use administration tool for Laravel applications, made with Laravel, Alpine.js, and Tailwind CSS.

Nebula Nebula is a minimalistic and easy to use administration tool for Laravel applications, made with Laravel, Alpine.js, and Tailwind CSS. Nebula m

Nebula 228 Nov 11, 2022
A simple blog app where a user can signup , login, like a post , delete a post , edit a post. The app is built using laravel , tailwind css and postgres

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Nahom_zd 1 Mar 6, 2022
This package provides a console command to convert dynamic JS/CSS to static JS/CSS assets.

Laravel Nova Search This package provides a console command to convert dynamic JS/CSS to static JS/CSS assets. Requirements laravel-mix v6.0+ php 7.3+

Akki Khare 3 Jul 19, 2022
CSS Exfil helper script to generate injected CSS and corresponding HTML (inspired by mike gualtieri)

The PoC-CSS Exfill Basic Keylogger First of all i was developing bot stuff and i seen attribute=value] [target=_blank] in source code of website. This

Ahsen 6 Apr 2, 2022
Twig-lint - Standalone twig linter

twig-lint - Standalone twig linter twig-lint is a lint tool for your twig files. It can be useful to integrate in your ci setup or as the basis of edi

Alexander 118 Dec 21, 2022
Tailwind scaffolding for the Laravel framework.

Introduction Laravel Jetstream is a beautifully designed application scaffolding for Laravel. Jetstream provides the perfect starting point for your n

Devanox Private Limited 0 Jul 20, 2022
Laravel package to generate and to validate a UUID according to the RFC 4122 standard. Only support for version 1, 3, 4 and 5 UUID are built-in.

Laravel Uuid Laravel package to generate and to validate a universally unique identifier (UUID) according to the RFC 4122 standard. Support for versio

Christoph Kempen 1.7k Dec 28, 2022
Sweetalert and Toaster notifications for Laravel livewire with support for tailwind and bootstrap.

Larabell Integrate livewire with sweetalert. Installation How to use Sweetalert Toast Available configuration Installation composer require simtabi/la

Simtabi 3 Jul 27, 2022
It's like React for PHP. Powered by Laravel, Livewire, Tailwind, & Alpine.

Tailwire It's like React for PHP. Powered by Laravel, Livewire, Tailwind, & Alpine. Features: Use a custom view component class namespace Declare rout

null 5 Dec 12, 2021
Aplicación Laravel-Livewire-Tailwind. La aplicación se conecta a APIRest y muestra resultados, búsquedas, historial, Responsive Design

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Juan Gómez 0 Feb 10, 2022
This template should help get you started developing with laravel 9 + Vue 3 in Vite + Tailwind

simple-project This template should help get you started developing with laravel 9 + Vue 3 in Vite + Tailwind

Yemeni Open Source 4 Oct 5, 2022
Ajar anak anak software looka integrate tailwind

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Aliff Rosli 2 Dec 21, 2021
Livewire UI components with tailwind base style

WireUI ?? Documentation Wire UI is a library of components and resources to empower your Laravel and Livewire application development. Starting a new

WireUi 811 Jan 2, 2023
Jetstrap is a lightweight laravel 8 package that focuses on the VIEW side of Jetstream / Breeze package installed in your Laravel application

A Laravel 8 package to easily switch TailwindCSS resources generated by Laravel Jetstream and Breeze to Bootstrap 4.

null 686 Dec 28, 2022
A Laravel chat package. You can use this package to create a chat/messaging Laravel application.

Chat Create a Chat application for your multiple Models Table of Contents Click to expand Introduction Installation Usage Adding the ability to partic

Tinashe Musonza 931 Dec 24, 2022
Laravel Form builder for version 5+!

Laravel 5 form builder Form builder for Laravel 5 inspired by Symfony's form builder. With help of Laravels FormBuilder class creates forms that can b

Kristijan Husak 1.7k Dec 31, 2022