{% macro render_icon(name, size=config.BOOTSTRAP_ICON_SIZE, color=config.BOOTSTRAP_ICON_COLOR, sprite=config.ICON_SPRITE_URL, title=None, desc=None) -%} {%- set bootstrap_colors = ["primary", "secondary", "success", "danger", "warning", "info", "light", "dark", "muted"] %} {%- if color and color in bootstrap_colors %} {%- set text_color = " text-" + color %} {%- elif color %} {%- set fill_color = color %} {%- endif -%} {%- if title is not none %}{{ title }}{% endif -%} {%- if desc is not none %}{{ desc }}{% endif -%} {%- if sprite -%} {%- else -%} {%- endif -%} {%- endmacro %}