style: align with the ep-corporate-design skill
This commit is contained in:
1 parent
50ef662dd3
commit
ebad54e989
162 files changed
+768
-640
No files matched your search
@@ -1,11 +1,16 @@
|
||||
{% set type = type|default('info') %}
|
||||
|
||||
{# light with a coloured left bar, as the notices of the apps portal (EP/apps Alert.tsx) #}
|
||||
<div class="{{ html_classes('p-4 mb-4 flex items-start space-x-2 border-l-4', { 'border-brand bg-brand-light text-ink': type == 'info', 'border-red-700 bg-red-50 text-red-950': type == 'warning', 'border-emerald-700 bg-emerald-50 text-emerald-950': type == 'success' }) }}">
|
||||
{{ icon(type == 'success' ? 'check' : 'alert', 'w-5 h-5 shrink-0') }}
|
||||
<div class="leading-relaxed text-base">
|
||||
{% block message %}
|
||||
{{ message | nl2br }}
|
||||
{% endblock %}
|
||||
</div>
|
||||
{#
|
||||
A notice in the style of the apps template's Alert.tsx (ep-corporate-design): `type` is success,
|
||||
error, warning or info, `message` the text; `embed` it and fill the `message` block for markup.
|
||||
Errors are announced at once (role="alert"), the others politely.
|
||||
#}
|
||||
{% set styles = {
|
||||
success: ['border-emerald-700 bg-emerald-50 text-emerald-950', 'Erledigt'],
|
||||
error: ['border-red-700 bg-red-50 text-red-950', 'Fehler'],
|
||||
warning: ['border-amber-600 bg-amber-50 text-amber-950', 'Achtung'],
|
||||
info: ['border-brand bg-brand-light text-ink', 'Hinweis'],
|
||||
} %}
|
||||
{% set style = styles[type ?? 'info'] %}
|
||||
<div role="{{ type == 'error' ? 'alert' : 'status' }}" class="notice mb-4 {{ style[0] }}">
|
||||
<span class="sr-only">{{ style[1] }}: </span>
|
||||
{%- block message %}{{ message|nl2br }}{% endblock -%}
|
||||
</div>
|
||||
Reference in new issue
Block a user