-
Notifications
You must be signed in to change notification settings - Fork 33
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
Changing font size doesn't work with SVGR and Tailwind #13
Comments
Hi, You should use svg {
width: 1em;
height: 1em;
fill: currentColor;
} |
Hi yes, you are right, using Anyways I have also tried with React compoents with Tailwind font classes.
Could it be that svg themselves are not optimized? |
Are you using the latest version of material-symbols? Similar issue used to be present in older versions (< 0.4.0) due to SVGs missing viewBox property. |
I have installed the I have inspected the react rendered svgs, they don't have the viewBox property. |
I have compared the SVG code from this repo the the SVGs that are rendered on my app. In this repo the SVGs do have the viewBox attribute, but when they are rendered on my App with SVGR they are missing the viewBox attribute. This would be an issue with SVGR then? |
I'm having a hard time adjusting the size of these icons. I changed to 'em' instead of 'rem' and it is still not working. I don't know what to do honestly. |
Hello,
I am able to import the svgs as React components into my Next.js App via SVGR. They render in the browser.
I am having problem changing the size of the icons by font size.
I have added this to my global css to change the icons by font size:
I then call the components with Tailwindcss class like this:
<Face className="text-8xl" />
In the browser the Face icon gets cropped and is not the correct size.
Any ideas why?
The text was updated successfully, but these errors were encountered: