baseline
This commit is contained in:
44
templates/partials/app-tile.phtml
Normal file
44
templates/partials/app-tile.phtml
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @var string $href
|
||||
* @var string $label
|
||||
* @var string|null $count
|
||||
* @var string|null $icon
|
||||
* @var string|null $iconBg
|
||||
* @var string|null $iconColor
|
||||
* @var string|null $class
|
||||
*/
|
||||
|
||||
$href = $href ?? '#';
|
||||
$label = $label ?? '';
|
||||
$count = $count ?? null;
|
||||
$icon = $icon ?? 'bi bi-grid-1x2';
|
||||
$iconBg = $iconBg ?? null;
|
||||
$iconColor = $iconColor ?? null;
|
||||
$class = $class ?? '';
|
||||
|
||||
$styleParts = [];
|
||||
if ($iconBg) {
|
||||
$styleParts[] = '--tile-icon-bg:' . $iconBg;
|
||||
}
|
||||
if ($iconColor) {
|
||||
$styleParts[] = '--tile-icon-color:' . $iconColor;
|
||||
}
|
||||
$style = $styleParts ? implode(';', $styleParts) . ';' : '';
|
||||
|
||||
?>
|
||||
<a class="app-tile<?php echo $class ? ' ' . $class : ''; ?>" href="<?php e($href); ?>" <?php if ($style) : ?>style="<?php e($style); ?>"<?php endif; ?>>
|
||||
<span class="app-tile-icon">
|
||||
<i class="<?php e($icon); ?>" aria-hidden="true"></i>
|
||||
</span>
|
||||
<?php if ($count !== null && $count !== '') : ?>
|
||||
<span class="app-tile-count"><?php e($count); ?></span>
|
||||
<?php endif; ?>
|
||||
<?php if ($label !== '') : ?>
|
||||
<span class="app-tile-label"><?php e($label); ?></span>
|
||||
<?php endif; ?>
|
||||
<span class="app-tile-link" aria-hidden="true">
|
||||
<i class="bi bi-box-arrow-up-right"></i>
|
||||
</span>
|
||||
</a>
|
||||
Reference in New Issue
Block a user