Compare commits
3 Commits
46810c675e
...
55ddc3b5e2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
55ddc3b5e2 | ||
| 6182935a22 | |||
|
|
2d5729ded6 |
@ -26,6 +26,7 @@ class Tailwindcss4Merger
|
||||
$atLayerComponents = $this->getLayerComponents($styles);
|
||||
$atProperty = $this->getProperties($styles);
|
||||
$atLayerProperties = $this->getLayerProperties($styles);
|
||||
$unlayered = $this->getUnlayered($styles);
|
||||
return implode(chr(10), [
|
||||
$atLayerOrder,
|
||||
$atLayerBase,
|
||||
@ -34,6 +35,7 @@ class Tailwindcss4Merger
|
||||
$atLayerComponents,
|
||||
$atProperty,
|
||||
$atLayerProperties,
|
||||
$unlayered,
|
||||
]);
|
||||
}
|
||||
|
||||
@ -122,7 +124,8 @@ class Tailwindcss4Merger
|
||||
{
|
||||
$matches = $this->getLayerByName($styles, 'properties');
|
||||
$properties = [
|
||||
' @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
|
||||
' @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline)'
|
||||
. ' and (not (color:rgb(from red r g b)))) {
|
||||
*, ::before, ::after, ::backdrop {'
|
||||
];
|
||||
foreach ($matches as $match) {
|
||||
@ -144,4 +147,11 @@ class Tailwindcss4Merger
|
||||
{
|
||||
return '@layer ' . $name . " {\n" . implode("\n", $styles) . "\n}";
|
||||
}
|
||||
|
||||
protected function getUnlayered(string $styles): string
|
||||
{
|
||||
$unlayered = preg_replace('/(?<layer>@layer[^;{]+;)/i', '', $styles, -1);
|
||||
$unlayered = preg_replace('/@layer[^{;]+\{.+?(?=\n})\n}/s', '', $unlayered, -1);
|
||||
return preg_replace('/(?<property>@property[^{]+\{[^}]+})/i', '', $unlayered, -1);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user