Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/vendeka-nl/tailwind-config-php

Save your tailwind.config.js as a PHP file.
https://github.com/vendeka-nl/tailwind-config-php

npm-package php tailwind tailwindcss

Last synced: 10 days ago
JSON representation

Save your tailwind.config.js as a PHP file.

Awesome Lists containing this project

README

        

# Use your TailwindCSS config in PHP

![npm (scoped)](https://img.shields.io/npm/v/@vendeka/tailwind-config-php)

## Installation
```
npm install --global @vendeka/tailwind-config-php
```

## Usage

Browse to the directory where your [TailwindCSS config file](https://tailwindcss.com/docs/configuration/) is located and execute:

```
tw2php
```

By default it reads `tailwind.config.js` and writes to `tailwind.config.php`. You can override the file names using the `--config`/`-c` and `--output`/`-o` options.

```
tw2php -c tailwind.js -o config/tailwind.php
tw2php --config tailwind.js --output config/tailwind.php
```

Now you can use the resolved config in your PHP as an object.

```php
theme->colors->gray->{500};
```

Please remember that the PHP file does not automatically update.