Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

View component x-icon defaults to 1em x 1em and doesn't include method to override this #1955

Open
Assignees
Labels
@iamdadmin

Description

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

  1. 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.
  2. 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.

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    AltStyle によって変換されたページ (->オリジナル) /