55 lines
1.3 KiB
PHP
55 lines
1.3 KiB
PHP
<?php
|
|
|
|
require_once __DIR__ . '/../vendor/autoload.php';
|
|
|
|
use PHPNative\Tailwind\StyleParser;
|
|
|
|
// Test shadow parsing
|
|
$testStyles = [
|
|
'shadow-sm',
|
|
'shadow',
|
|
'shadow-md',
|
|
'shadow-lg',
|
|
'shadow-xl',
|
|
'shadow-2xl',
|
|
'shadow-inner',
|
|
'shadow-none',
|
|
];
|
|
|
|
echo "Testing Shadow Parsing:\n";
|
|
echo str_repeat('=', 50) . "\n\n";
|
|
|
|
foreach ($testStyles as $styleString) {
|
|
echo "Testing: '{$styleString}'\n";
|
|
|
|
$styles = StyleParser::parse($styleString);
|
|
|
|
echo "Parsed StyleCollection:\n";
|
|
|
|
echo 'Number of styles: ' . $styles->count() . "\n";
|
|
|
|
foreach ($styles as $style) {
|
|
echo ' - Style type: ' . get_class($style->style) . "\n";
|
|
if ($style->style instanceof \PHPNative\Tailwind\Style\Shadow) {
|
|
echo ' Shadow size: ' . $style->style->size . "\n";
|
|
}
|
|
}
|
|
|
|
echo "\n";
|
|
}
|
|
|
|
// Test combined styles
|
|
echo "\nTesting combined style:\n";
|
|
echo str_repeat('=', 50) . "\n";
|
|
$combined = 'px-6 py-3 bg-blue-500 text-white rounded-lg shadow-lg';
|
|
echo "Testing: '{$combined}'\n";
|
|
$styles = StyleParser::parse($combined);
|
|
echo 'Number of styles: ' . $styles->count() . "\n";
|
|
foreach ($styles as $style) {
|
|
echo ' - ' . get_class($style->style);
|
|
if ($style->style instanceof \PHPNative\Tailwind\Style\Shadow) {
|
|
echo ' (size: ' . $style->style->size . ')';
|
|
}
|
|
echo "\n";
|
|
}
|