PHPackages                             approvedio/laravel-tailwind-config - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. approvedio/laravel-tailwind-config

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

approvedio/laravel-tailwind-config
==================================

Get access to the tailwind config values in your Laravel Project

v0.1.1(6y ago)12535MITPHPPHP &gt;=5.5.9

Since May 29Pushed 6y ago1 watchersCompare

[ Source](https://github.com/approvedio/laravel-tailwind-config)[ Packagist](https://packagist.org/packages/approvedio/laravel-tailwind-config)[ RSS](/packages/approvedio-laravel-tailwind-config/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

Laravel Tailwind Config
=======================

[](#laravel-tailwind-config)

I've recently found myself using Tailwind more and more but have run into a few situations where I need to access tailwind config values within my blade templates. The most recent event occurred when building a admin section and i needed to access a color defined within the tailwind config file to pass to a charting library. Instead of hardcoding the value I decided to create this library

Installation
------------

[](#installation)

```
composer require approvedio/laravel-tailwind-config
```

### Laravel 5.5+

[](#laravel-55)

The application service provider and facade will be automatically registered for you.

### Laravel 5.4 and Below

[](#laravel-54-and-below)

Add the service provider to your app.php config file

```
ApprovedDigital\LaravelTailwindConfig\LaravelTailwindConfigServiceProvider::class,

```

Optionally you can add the facade to the Aliases section of your app.php config file

```
'Tailwind' => ApprovedDigital\LaravelTailwindConfig\Facades\LaravelTailwindConfigFacade::class.

```

Usage
-----

[](#usage)

You can use the facade

```
Tailwind::get('colors.red-light', '#FF0000');
```

You can use the helper method

```
tailwind('colors.red-light', '#FF0000');
```

Config
------

[](#config)

By default we assume your tailwind config file is called tailwind.json in the root of your project. you can override this configuration by publishing the config and updating the path to your tailwind.json file.

```
'cache_path' => base_path('tailwind.json'),
```

To generate the tailwind.json file from your config you will need to add the following Mix extension to your webpack.mix.js

```
mix.extend('exportTailwindConfig', function(webpackConfig, configPath = './tailwind.js') {
    let fs = require('fs');
    let config = require(configPath);
    let json = JSON.stringify(config, null, 2);

    fs.writeFile('./tailwind.json', json);
});
```

And then call the following mix function to generate this file

```
mix.exportTailwindConfig('./tailwind.js');
```

\##Future Development

- Extract Tailwind Config Extractor into a dedicated package and less janky package

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~372 days

Total

2

Last Release

2533d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9f4d2698f8f880d8298978ae981bfc9a182eb38e7a2af1e620e8dd0e2dcf7e1f?d=identicon)[approvedio](/maintainers/approvedio)

---

Top Contributors

[![boffey](https://avatars.githubusercontent.com/u/1876437?v=4)](https://github.com/boffey "boffey (5 commits)")[![oxyc](https://avatars.githubusercontent.com/u/302736?v=4)](https://github.com/oxyc "oxyc (1 commits)")

### Embed Badge

![Health badge](/badges/approvedio-laravel-tailwind-config/health.svg)

```
[![Health](https://phpackages.com/badges/approvedio-laravel-tailwind-config/health.svg)](https://phpackages.com/packages/approvedio-laravel-tailwind-config)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M158](/packages/orchestra-canvas)[illuminate/pipeline

The Illuminate Pipeline package.

9446.6M213](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M862](/packages/illuminate-pagination)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[spatie/laravel-mix-preload

Add preload and prefetch links based your Mix manifest

169176.0k2](/packages/spatie-laravel-mix-preload)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
