-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhelpers.php
46 lines (41 loc) · 1.05 KB
/
helpers.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
use tobimori\TwMerge;
if (!function_exists('attr')) {
/**
* Generates a list of HTML attributes, and intelligently merges classes with Tailwind Merge.
*/
function attr(
array|null $attr = null,
string|null $before = null,
string|null $after = null
): string|null {
return TwMerge::attr($attr, null, $before, $after);
}
}
if (!function_exists('merge')) {
/**
* Outputs the class html attribute and intelligently merges classes with Tailwind Merge.
*/
function merge(...$classes): string
{
return TwMerge::merge($classes);
}
}
if (!function_exists('cls')) {
/**
* Outputs the contents of the class html attribute and intelligently merges classes with Tailwind Merge.
*/
function cls(...$classes): string
{
return TwMerge::cls($classes);
}
}
if (!function_exists('mod')) {
/**
* Modifies all classes with the given modifier and intelligently merges classes with Tailwind Merge.
*/
function mod(string $modifier, string $classes): string
{
return TwMerge::modify($modifier, $classes);
}
}