Add cursor pointer class on hover
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -249,6 +249,7 @@ class IconExtensionTest extends TestCase
|
||||
public function testSvgClassContainsHoverPalleteClasses(): void
|
||||
{
|
||||
$contents = $this->icon->renderIcon(['icon' => self::ICON, 'hover' => 'white']);
|
||||
$this->assertMatchesRegularExpression('/<svg.+class=".*cursor-pointer.*".*>/', $contents);
|
||||
$this->assertMatchesRegularExpression('/<svg.+class=".*hover:fill-white.*".*>/', $contents);
|
||||
$this->assertMatchesRegularExpression('/<svg.+class=".*hover:stroke-white.*".*>/', $contents);
|
||||
$this->assertMatchesRegularExpression('/<svg.+class=".*group-hover:fill-white.*".*>/', $contents);
|
||||
@@ -260,6 +261,7 @@ class IconExtensionTest extends TestCase
|
||||
$contents = $this->icon->renderIcon(['icon' => self::ICON, 'hover' => 'white', 'colour' => 'primary']);
|
||||
$this->assertMatchesRegularExpression('/<svg.+class=".*fill-primary.*".*>/', $contents);
|
||||
$this->assertMatchesRegularExpression('/<svg.+class=".*stroke-primary.*".*>/', $contents);
|
||||
$this->assertMatchesRegularExpression('/<svg.+class=".*cursor-pointer.*".*>/', $contents);
|
||||
$this->assertMatchesRegularExpression('/<svg.+class=".*hover:fill-white.*".*>/', $contents);
|
||||
$this->assertMatchesRegularExpression('/<svg.+class=".*hover:stroke-white.*".*>/', $contents);
|
||||
$this->assertMatchesRegularExpression('/<svg.+class=".*group-hover:fill-white.*".*>/', $contents);
|
||||
|
||||
Reference in New Issue
Block a user