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

react-native --icon should be 24 not 1em #571

Closed
FDiskas opened this issue Jun 26, 2021 · 9 comments · Fixed by #625
Closed

react-native --icon should be 24 not 1em #571

FDiskas opened this issue Jun 26, 2021 · 9 comments · Fixed by #625
Labels

Comments

@FDiskas
Copy link

FDiskas commented Jun 26, 2021

🐛 Bug Report

In react native 1em width does nothing - suppose to be rem?

To Reproduce

Go to playground https://react-svgr.com/playground/?icon=true&native=true&typescript=true

Expected behavior

I would like to get results with width and height as 24

<Svg
      xmlns="http://www.w3.org/2000/svg"
      width={24}
      height={24}

Workaround in .svgrrc.js

        [
          "@svgr/babel-plugin-replace-jsx-attribute-value",
          {
            "values": [
              { "value": "1em", "newValue": 24 },
            ]
          }
        ]
## System:
 - OS: macOS 11.4
 - CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
 - Memory: 49.51 MB / 16.00 GB
 - Shell: 5.8 - /bin/zsh
## Binaries:
 - Node: 14.17.0 - ~/.nvm/versions/node/v14.17.0/bin/node
 - Yarn: 1.22.10 - ~/.nvm/versions/node/v14.17.0/bin/yarn
 - npm: 6.14.13 - ~/.nvm/versions/node/v14.17.0/bin/npm
 - Watchman: 2021.06.07.00 - /usr/local/bin/watchman
## npmPackages:
 - @svgr/cli: ^5.5.0 => 5.5.0 
@open-collective-bot
Copy link

Hey @FDiskas 👋,
Thank you for opening an issue. We'll get back to you as soon as we can.
Please, consider supporting us on Open Collective. We give a special attention to issues opened by backers.
If you use SVGR at work, you can also ask your company to sponsor us ❤️.

@stale
Copy link

stale bot commented Aug 27, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Aug 27, 2021
@stale stale bot closed this as completed Sep 3, 2021
@FDiskas
Copy link
Author

FDiskas commented Sep 3, 2021

👯‍♂️

@gregberge gregberge reopened this Sep 12, 2021
@stale stale bot removed the wontfix label Sep 12, 2021
@gregberge
Copy link
Owner

@FDiskas why the choice of 24? 1em = 16px by default in browser.

@FDiskas
Copy link
Author

FDiskas commented Sep 13, 2021

Yes you are right. Why px? It's more universal unit. This module is used not only on web. 1em does nothing in native mobile apps

@gregberge
Copy link
Owner

@FDiskas no I mean why choosing 24 instead of 16?

@FDiskas
Copy link
Author

FDiskas commented Sep 17, 2021

Good question, don't know. Just numbers :)
I'm selfish 24 better looks on react native mobile app :)

@gregberge
Copy link
Owner

@FDiskas OK we need to make it configurable then. There is no way to specify something that can be decided later by user or implied by font size like em?

@FDiskas
Copy link
Author

FDiskas commented Sep 17, 2021

I was thinking 🤔 if there is option "native" so that could mean that em is not valid any more in the output and would be replaced to simple integers if it has --icon pram. But to configure the output size would be nice addition. Like: --icon=16 or something

gregberge added a commit that referenced this issue Nov 13, 2021
BREAKING CHANGE: using --icon as latest arg now requires "--"

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

Successfully merging a pull request may close this issue.

2 participants