[1.0.0-beta1] Remove IconDefinition::DEFAULT_TEMPLATE

Created on 13 September 2024, about 1 year ago
Updated 18 September 2024, 12 months ago

Problem/Motivation

class IconDefinition implements IconDefinitionInterface {

  private const DEFAULT_TEMPLATE = '<img class="icon icon-{{ icon_id|clean_class }}" src="{{ source }}" title="{{ title|default(name) }}" alt="{{ alt|default(name) }}" width="{{ width|default(24) }}" height="{{ height|default(24) }}">';

}

This constant is problematic:

  • it promotes title, alt, width & default but they are only icon pack related settings, we can't be renamed or removed according to the icon pack upstream documentation.
  • because 📌 [1.0.0-beta1] Clean *.ui_icons.yml Needs work was not done yet (it was planned for beta2, but I have just moved it to beta1), it gave the false illusion than most of those very specific templates can be factorized.
  • it is not compatible with extractor already planned or not, and it may confused the icon pack author which will not understand why its icon pack is not rendering correctly. Example: ✨ [1.0.0-beta2] Add font/codepoint icon extractor Needs work
  • any change in this constant in a future version of UI Icons can break all iconpack relying on the default

Proposed resolution

So:

  • remove the constant
  • make the template property mandatory in JSON schema
  • put the expected template code in iconpack, according to the upstream documentation
  • do also similar task 📌 [1.0.0-beta1] Clean *.ui_icons.yml Needs work
📌 Task
Status

Closed: outdated

Version

1.0

Component

Code

Created by

🇫🇷France pdureau Paris

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024