Rename sheen to glossy

This commit is contained in:
brabli
2026-04-30 14:40:39 +01:00
parent 5046edb4c9
commit 25d5441184
2 changed files with 10 additions and 4 deletions
+2 -2
View File
@@ -28,7 +28,7 @@
<h2 class="text-lg font-semibold mb-3">Solid (all colours)</h2>
<div class="flex flex-wrap gap-2">
{% for colour in colours %}
<twig:Pcm:Badge colour="{{ colour }}">{{ colour }}</twig:Pcm:Badge>
<twig:Pcm:Badge glossy colour="{{ colour }}">{{ colour }}</twig:Pcm:Badge>
{% endfor %}
</div>
</section>
@@ -68,7 +68,7 @@
<div class="flex gap-2 flex-col">
{% for icon_sample in icon_samples %}
<twig:Pcm:Badge icon :obj="icon_sample" class="text-xl">{{ icon_sample.label }}</twig:Pcm:Badge>
<twig:Pcm:Badge glossy icon :obj="icon_sample" class="text-xl">{{ icon_sample.label }}</twig:Pcm:Badge>
{% endfor %}
</div>
+8 -2
View File
@@ -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) {