Tempest version
3.x
PHP version
8.5
Operating system
Linux
Description
Reference: https://iconify.design/docs/usage/svg/no-code/
By default the Iconify API returns a SVG with height and width attributes set to 1em.
The tempest/icon class doesn't currently expose a prop to override this.
The tempest/view x-icon component does add a $class prop, but does not override the width and height attributes.
I've found this to be incompatible with tailwind height and width utilities in the class string, instead defaulting to the width and height attributes. That could be a precedence or browser rendering issue, but nonetheless highlights the default behaviour is fixed and not developer-controllable.
Steps to reproduce
Use <x-icon to render any icon and you will see the returned HTML includes the width and height attributes
Possible fixes
- Add
?height=none to the download url in icon.config.php and allow the <x-icon class attribute defined by the developer to control height and width, with perhaps a default of 1em applied here for easy control.
- Add the
width and height props to tempest/icon class which in turn is filled from <x-icon height="" width="" attributes. More extensive changes to tempest/icon and possibly not proportionate given the simplicity of option 1 and little added benefit.
Tempest version
3.x
PHP version
8.5
Operating system
Linux
Description
Reference: https://iconify.design/docs/usage/svg/no-code/
By default the Iconify API returns a SVG with
heightandwidthattributes set to1em.The
tempest/iconclass doesn't currently expose a prop to override this.The
tempest/viewx-iconcomponent does add a$classprop, but does not override thewidthandheightattributes.I've found this to be incompatible with tailwind height and width utilities in the class string, instead defaulting to the width and height attributes. That could be a precedence or browser rendering issue, but nonetheless highlights the default behaviour is fixed and not developer-controllable.
Steps to reproduce
Use
<x-iconto render any icon and you will see the returned HTML includes thewidthandheightattributesPossible fixes
?height=noneto the download url inicon.config.phpand allow the<x-icon classattribute defined by the developer to control height and width, with perhaps a default of 1em applied here for easy control.widthandheightprops totempest/iconclass which in turn is filled from<x-icon height="" width=""attributes. More extensive changes totempest/iconand possibly not proportionate given the simplicity of option 1 and little added benefit.