diff --git a/dev/templates/showcase.html.twig b/dev/templates/showcase.html.twig index 7cf2f6a..5e0f7c6 100644 --- a/dev/templates/showcase.html.twig +++ b/dev/templates/showcase.html.twig @@ -28,7 +28,7 @@

Solid (all colours)

{% for colour in colours %} - {{ colour }} + {{ colour }} {% endfor %}
@@ -68,7 +68,7 @@
{% for icon_sample in icon_samples %} - {{ icon_sample.label }} + {{ icon_sample.label }} {% endfor %}
diff --git a/src/Twig/Component/Badge.php b/src/Twig/Component/Badge.php index eae4f1d..77583b8 100644 --- a/src/Twig/Component/Badge.php +++ b/src/Twig/Component/Badge.php @@ -29,7 +29,7 @@ final class Badge * @param bool $outline Whether the badge should be rendered with an outline * @param ?string $icon */ - public function mount(?BadgeableInterface $obj = null, ?string $class = null, ?string $colour = null, ?string $label = null, bool $outline = false, ?string $icon = null): void + public function mount(?BadgeableInterface $obj = null, ?string $class = null, ?string $colour = null, ?string $label = null, bool $outline = false, ?string $icon = null, bool $glossy = false): void { if (!$icon) { @@ -74,7 +74,13 @@ final class Badge if (true === $outline) { $classes = sprintf('bg-white %s/30 %s %s %s', $palette->borderColourClass, $palette->textColourClass, $this->baseClasses, $class); } else { - $classes = sprintf('text-white %s %s %s %s', $palette->borderColourClass, $palette->backgroundColourClass, $this->baseClasses, $class); + if ($glossy) { + $glossy = 'bg-[image:radial-gradient(ellipse_at_top_left,rgba(255,255,255,0.25),transparent_65%),linear-gradient(to_bottom,rgba(255,255,255,0.05),rgba(0,0,0,0.12))]'; + } else { + $glossy = ''; + } + + $classes = sprintf('text-white border-transparent %s %s %s %s', $palette->backgroundColourClass, $glossy, $this->baseClasses, $class); } if ($this->icon !== null) {