{% trans "Inline SVG icons rendered via the " %}{% templatetag openbrace %}{% templatetag openbrace %} dcr_icon {% templatetag closebrace %}{% templatetag closebrace %}{% trans " template tag. All icons use " %}viewBox="0 0 24 24"{% trans " with no hardcoded dimensions — size them entirely through CSS. Pass an optional " %}css_class{% trans " argument to inject class(es) onto the element." %} {% trans "The tag also accepts an image URL or path — in that case an " %}<img>{% trans " is emitted instead of an SVG, enabling custom logos and brand assets." %}
{% trans "Usage" %}
{# Load once at the top of the template #}
{% verbatim %}{% load dcr_icons %}
{# Full
{% trans "Composable color classes for any icon container. Apply " %}dcr-icon-color--<name>{% trans " alongside any sizing class — " %}dcr-panel-card__icon-wrap{% trans " for cards, " %}dcr-page-header__icon{% trans " for page headers, or any custom element. Color cascades to the SVG via " %}currentColor{% trans "." %}
{% trans "Usage" %}
{# Card icon wrap — tinted (default for panel cards) #}
{% verbatim %}
{# Page header icon — tinted #}
{# Page header icon — solid #}
{# PanelPlugin — set icon_color on the plugin class #}
class MyPanel(PanelPlugin):
icon = "chart"
icon_color = "warning" # tinted
icon_color = "warning-solid" # solid
icon_color = "" # plain wrap, no color modifier (e.g. for logo images){% endverbatim %}
{# Tinted variants: accent · success · warning · danger · info · indigo · purple · muted #}
{# Solid variants: append -solid to any tinted name, e.g. success-solid #}
{# No modifier: icon_color = "" — plain wrap, useful with custom logo images #}
{% trans "Pass a relative static path or an absolute URL as " %}icon{% trans " to render a custom logo or brand image instead of an SVG. The path is resolved via Django's staticfiles system at render time, so it works correctly regardless of " %}STATIC_URL{% trans " or CDN settings. Set " %}icon_color = \"\"{% trans " for a plain wrap with no background tint — or keep a tint for contrast." %}
{% trans "panel.py" %}
{% verbatim %}# Place the logo at: my_panel/static/my_panel/images/logo.png
# Django resolves it via staticfiles at render time — STATIC_URL-agnostic.
class MyPanel(PanelPlugin):
name = "My Panel"
description = "Integrates with a third-party service"
icon = "my_panel/images/logo.png"
icon_color = "" # plain wrap — no background tint
# icon_color = "muted" # subtle grey tint for contrast{% endverbatim %}