Be able to set settings per icon in field

Created on 18 December 2024, 4 months ago

Problem/Motivation

Currently it is only possible to set the icon pack settings (size, width, height, etc.), in field formatter (, CKE5, menus) but not per field value.

For Bootstrap icons it is ok because icons are squared, same ratio. But for Fontawesome icons, the ratio may change per icon. So even with a relative size in em, icons can be cropped or deformed.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Active

Version

1.0

Component

UI Icons Field

Created by

🇫🇷France Grimreaper France 🇫🇷

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

Comments & Activities

  • Issue created by @Grimreaper
  • 🇫🇷France pdureau Paris

    Currently it is only possible to set the icon pack settings (size, width, height, etc.), in field formatter (, CKE5, menus) but not per field value.

    It was done in purpose. Field storage is for data only (icon pack + icon ID), field formatter is for how it looks (settings). For example, yo uwant to add an icon to a content but this icon will look differently in full page, card, banner, search results...

    But for Fontawesome icons, the ratio may change per icon. So even with a relative size in em, icons can be cropped or deformed.

    Maybe the setting is not propertly defined. Can you share your iconpack definition?

  • 🇫🇷France Grimreaper France 🇫🇷

    https://git.drupalcode.org/project/sobki_profile_bootstrap/-/blob/10.0.x...

    I understand for different view modes. But the problem is even for the same view mode, if changing the icon change the ratio it can't be handled.

  • 🇫🇷France Grimreaper France 🇫🇷

    Seen with @pdureau,

    We found a way to adapt the icon pack template to use automatically the viewbox.

Production build 0.71.5 2024