Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

svg Height and Width "inherit" values are invalid #2

Open
alixroyere opened this issue Dec 13, 2023 · 0 comments
Open

svg Height and Width "inherit" values are invalid #2

alixroyere opened this issue Dec 13, 2023 · 0 comments

Comments

@alixroyere
Copy link

alixroyere commented Dec 13, 2023

Hello,
I'm trying to use this library, but it generates 2 warnings for each icon in the browser console:

Valeur inherit inattendue lors de l’analyse de l’attribut width.
Valeur inherit inattendue lors de l’analyse de l’attribut height.

This can be translated to "Unexpected value for width/height attribute"

In fact, each svg contains "inherit" for width and height, but they are not valid values in svg.
<svg width="inherit" height="inherit" viewBox="0 0 24 24"
https://github.com/480-Design/Solar-Icon-Set-React/blob/main/src/icons/Arrows/AltArrowDown.tsx

https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/width#svg
https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/height#svg
Valid values for svg width and height are: auto | a length | a percentage

If we remove width="inherit" height="inherit" from svg, icon seems to still work and are still resizing when parent wrapper width and height are updated.

<span
      role="img"
      aria-hidden="true"
      style={{
        color: color,
        width: size,
        height: size,
        display: "inline-flex",
        fontSize: "inherit",
      }}
      {...restProps}
    >
      {icon}
    </span>

https://github.com/480-Design/Solar-Icon-Set-React/blob/main/src/icons/IconWrapper.tsx

So can we remove these props?

And is this project still maintained? Links on the readme are dead too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant