- Pipe macro title/description through | safe to render NBSP/& correctly
(autoescape was producing literal '95 %+' and 'Q&R' text on screen)
- Replace dynamic col-span-{{ span }} with static lookup table so Tailwind
scanner generates the utilities for A-2.7+ reuse
- Replace inline border style with border-white/[0.045] utility (codebase consistency)
- Add explicit Q&R assertion + autoescape regression guard test
15 lines
1.1 KiB
HTML
15 lines
1.1 KiB
HTML
{# Reusable bento card macro. FlexiHub style: dark navy2 surface, decorative watermark number, gradient icon corner.
|
|
`span` controls column span via a static lookup table (Tailwind's content scanner only sees literal class strings,
|
|
so dynamic `col-span-{{ span }}` would produce dead classes — the lookup keeps the utilities discoverable). #}
|
|
{% macro bento_card(number, title, description, icon='✦', span='1') %}
|
|
{%- set span_classes = {'1': 'col-span-1', '2': 'sm:col-span-2', '3': 'sm:col-span-2 md:col-span-3'} -%}
|
|
<div class="relative bg-brand-navy2 p-6 rounded-[18px] overflow-hidden border border-white/[0.045] {{ span_classes.get(span, 'col-span-1') }}">
|
|
<div class="absolute top-2 right-4 text-[80px] font-black text-white/[0.04]" aria-hidden="true">{{ number }}</div>
|
|
<div class="relative">
|
|
<div class="w-10 h-10 grad-bg rounded-[0.5rem] mb-4 flex items-center justify-center text-lg">{{ icon }}</div>
|
|
<h3 class="text-lg font-bold mb-2 text-white">{{ title | safe }}</h3>
|
|
<p class="text-sm text-white/70">{{ description | safe }}</p>
|
|
</div>
|
|
</div>
|
|
{% endmacro %}
|