Skip to content

Commit

Permalink
reduced whitespace and support for extra classes for icons
Browse files Browse the repository at this point in the history
  • Loading branch information
PanderMusubi committed Oct 18, 2023
1 parent 35c12a8 commit ba09b59
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions flask_bootstrap/templates/base/utils.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
{% endmacro %}


{% macro render_icon(name, size=config.BOOTSTRAP_ICON_SIZE, color=config.BOOTSTRAP_ICON_COLOR, title=None, desc=None) %}
{% set bootstrap_colors = ['primary', 'secondary', 'success', 'danger', 'warning', 'info', 'light', 'dark', 'muted'] %}
<svg class="bi{% if not color %}"{% elif color in bootstrap_colors %} text-{{ color }}"{% else %}" style="color: {{ color }}"{% endif %}
width="{{ size }}" height="{{ size }}" fill="currentColor">
{% if title is not none %}<title>{{ title }}</title>{% endif %}
{% if desc is not none %}<desc>{{ desc }}</desc>{% endif %}
<use xlink:href="{{ url_for('bootstrap.static', filename='icons/bootstrap-icons.svg') }}#{{ name }}"/>
</svg>
{% endmacro %}
{% macro render_icon(name, size=config.BOOTSTRAP_ICON_SIZE, color=config.BOOTSTRAP_ICON_COLOR, title=None, desc=None, classes=None) %}
{%- set bootstrap_colors = ['primary', 'secondary', 'success', 'danger', 'warning', 'info', 'light', 'dark', 'muted'] -%}
<svg class="bi{% if not color %}{% if classes %} {{ classes }}{% endif %}"
{%- elif color in bootstrap_colors %} text-{{ color }}"{% else %}" style="color: {{ color }}"{% endif -%}
{%- if size %} width="{{ size }}"{% endif %}{% if size %} height="{{ size }}"{% endif %} fill="currentColor">
{%- if title %}<title>{{ title }}</title>{% endif -%}
{%- if desc %}<desc>{{ desc }}</desc>{% endif -%}
<use xlink:href="{{ url_for('bootstrap.static', filename='icons/bootstrap-icons.svg') }}#{{ name }}"/></svg>
{%- endmacro %}


{% macro arg_url_for(endpoint, base) %}
Expand Down

0 comments on commit ba09b59

Please sign in to comment.