diff --git a/src/Twig/Functions/IconExtension.php b/src/Twig/Functions/IconExtension.php index 4bfbd5e..d0e4e3b 100644 --- a/src/Twig/Functions/IconExtension.php +++ b/src/Twig/Functions/IconExtension.php @@ -86,7 +86,7 @@ final class IconExtension extends AbstractExtension if (null !== $options['hover']) { $hoverPallete = $this->getPallete($options['hover']); - $colourClasses .= " hover:{$hoverPallete['stroke']} hover:{$hoverPallete['fill']} group-hover:{$hoverPallete['stroke']} group-hover:{$hoverPallete['fill']}"; + $colourClasses .= " cursor-pointer hover:{$hoverPallete['stroke']} hover:{$hoverPallete['fill']} group-hover:{$hoverPallete['stroke']} group-hover:{$hoverPallete['fill']}"; } $xml = new \SimpleXMLElement($cleanSvgMarkup); @@ -201,13 +201,3 @@ final class IconExtension extends AbstractExtension class IconNotFound extends \Exception {}; class PalleteNotFound extends \Exception {}; - -// class="stroke-neutral-400 fill-neutral-400" - -// hover:stroke-ses-highlight -// group-hover:stroke-ses-highlight - -// hover:fill-ses-highlight -// group-hover:fill-ses-highlight - -// cursor-pointer diff --git a/tests/Twig/Functions/IconExtensionTest.php b/tests/Twig/Functions/IconExtensionTest.php index 8f4b941..459f6b9 100644 --- a/tests/Twig/Functions/IconExtensionTest.php +++ b/tests/Twig/Functions/IconExtensionTest.php @@ -249,6 +249,7 @@ class IconExtensionTest extends TestCase public function testSvgClassContainsHoverPalleteClasses(): void { $contents = $this->icon->renderIcon(['icon' => self::ICON, 'hover' => 'white']); + $this->assertMatchesRegularExpression('//', $contents); $this->assertMatchesRegularExpression('//', $contents); $this->assertMatchesRegularExpression('//', $contents); $this->assertMatchesRegularExpression('//', $contents); @@ -260,6 +261,7 @@ class IconExtensionTest extends TestCase $contents = $this->icon->renderIcon(['icon' => self::ICON, 'hover' => 'white', 'colour' => 'primary']); $this->assertMatchesRegularExpression('//', $contents); $this->assertMatchesRegularExpression('//', $contents); + $this->assertMatchesRegularExpression('//', $contents); $this->assertMatchesRegularExpression('//', $contents); $this->assertMatchesRegularExpression('//', $contents); $this->assertMatchesRegularExpression('//', $contents);