[1.1.0] Improve Icon implementation

Created on 7 December 2024, 18 days ago

Problem/Motivation

This issue is a follow-up of issue 📌 [1.1.x] Adopts the new Icon API Active

Below some comments to be addressed.
---
this snippet is OK and repeated many times:

{% if icon.icon_id %}
{% set attributes = attributes.addClass([icon.icon_id ? 'fr-icon-' ~ icon.icon_id|clean_class, (icon.settings.size|default('md') != 'md') ? 'fr-icon--' ~ icon.settings.size|clean_class, icon.settings.color ? 'fr-text-' ~ icon.settings.color|clean_class]) %}
{% endif %}

{% set detail_end_attributes = detail_end_attributes.addClass(['fr-card__detail', detail_end_icon.icon_id ? 'fr-icon-' ~ detail_end_icon.icon_id|clean_class, (detail_end_icon.settings.size|default('md') != 'md') ? 'fr-icon--' ~ detail_end_icon.settings.size|clean_class]) %}

{{ detail_end }}

{% if not dismissible and icon.icon_id %}
{% set attributes = attributes.addClass([icon.icon_id ? 'fr-icon-' ~ icon.icon_id|clean_class, (icon.settings.size|default('md') != 'md') ? 'fr-icon--' ~ icon.settings.size|clean_class, icon.settings.color ? 'fr-text-' ~ icon.settings.color|clean_class]).addClass('fr-tag--icon-left') %}
{% endif %}

Let's see if we can make this more redable...

📌 Task
Status

Active

Version

1.1

Component

Code

Created by

🇫🇷France just_like_good_vibes PARIS

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024