Skip to content

Latest commit

 

History

History
17 lines (12 loc) · 480 Bytes

File metadata and controls

17 lines (12 loc) · 480 Bytes

Cn php

Simple tailwind merge wrapper for php that converts conditional classes into a single string.

It's using gehrisandro/tailwind-merge-php to merge tailwind classes.

use Performing\Cn\Cn;

$isDark = true;
Cn::merge('p-1 bg-red-500', ['text-white bg-blue-500' => $isDark]);
// p-1 text-white bg-blue-500

$isDark = false;
Cn::merge('p-1 bg-red-500', ['text-white bg-blue-500' => $isDark]);
// p-1 bg-red-500