castopod/app/Views/Components/Heading.php
Yassine Doghri a746a781b4 feat(themes): set generic css variables for colors to enable instance themes
- set new colors using the css variables for theming in tailwind.config.js
- replace admin and
public colors with new variable enabled colors
2021-12-29 12:06:10 +00:00

33 lines
847 B
PHP

<?php
declare(strict_types=1);
namespace App\Views\Components;
use ViewComponents\Component;
class Heading extends Component
{
protected string $tagName = 'div';
/**
* @var 'small'|'base'|'large'
*/
protected string $size = 'base';
public function render(): string
{
$sizeClasses = [
'small' => 'tracking-wide text-base',
'base' => 'text-xl',
'large' => 'text-3xl',
];
$class = $this->class . ' relative z-10 font-bold text-heading-foreground font-display before:w-full before:absolute before:h-1/2 before:left-0 before:bottom-0 before:rounded-full before:bg-heading-background before:z-[-10] ' . $sizeClasses[$this->size];
return <<<HTML
<{$this->tagName} class="{$class}">{$this->slot}</{$this->tagName}>
HTML;
}
}