Add group 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']}";
|
||||
$colourClasses .= " hover:{$hoverPallete['stroke']} hover:{$hoverPallete['fill']} group-hover:{$hoverPallete['stroke']} group-hover:{$hoverPallete['fill']}";
|
||||
}
|
||||
|
||||
$xml = new \SimpleXMLElement($cleanSvgMarkup);
|
||||
|
||||
@@ -248,9 +248,12 @@ class IconExtensionTest extends TestCase
|
||||
|
||||
public function testSvgClassContainsHoverPalleteClasses(): void
|
||||
{
|
||||
|
||||
$contents = $this->icon->renderIcon(['icon' => self::ICON, 'hover' => 'white']);
|
||||
$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);
|
||||
$this->assertMatchesRegularExpression('/<svg.+class=".*group-hover:stroke-white.*".*>/', $contents);
|
||||
}
|
||||
|
||||
public function testSvgClassContainsHoverAndColourPalleteClasses(): void
|
||||
@@ -260,6 +263,8 @@ class IconExtensionTest extends TestCase
|
||||
$this->assertMatchesRegularExpression('/<svg.+class=".*stroke-primary.*".*>/', $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);
|
||||
$this->assertMatchesRegularExpression('/<svg.+class=".*group-hover:stroke-white.*".*>/', $contents);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user