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

"fontSize" attribute not working in Icon component #44511

Closed
pradipjs opened this issue Nov 23, 2024 · 2 comments
Closed

"fontSize" attribute not working in Icon component #44511

pradipjs opened this issue Nov 23, 2024 · 2 comments
Assignees
Labels
duplicate This issue or pull request already exists package: icons Specific to @mui/icons

Comments

@pradipjs
Copy link

pradipjs commented Nov 23, 2024

Steps to reproduce

Steps:

  1. Open this link to live example: (required)
  2. https://stackblitz.com/edit/react-pwpelc?file=Demo.tsx
  3. Attribute fontSize has no effect to font size of the icon

Current behavior

Font size stays a same even if we set the value to small, large or medium.

Expected behavior

Fontsize should be as per the attribute value.

Context

It seems styles are not applying to icon component based on the attribute value.

Your environment

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Search keywords: "fontSize" attribute not working in Icon component

@pradipjs pradipjs added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Nov 23, 2024
@tneeraja95
Copy link

This is happening because the material icons are loaded after the styled-component for icon and material icons have a font-size of 24px which is overriding the styled-component's small/medium/large.

@zannager zannager added the package: icons Specific to @mui/icons label Nov 25, 2024
@DiegoAndai DiegoAndai assigned DiegoAndai and unassigned siriwatknp Nov 29, 2024
@DiegoAndai
Copy link
Member

DiegoAndai commented Nov 29, 2024

Hey @pradipjs, thanks for the report. This is (sadly) an old issue: #29689, so I'm closing this one as duplicate. I'll leave a workaround option in the original issue.

@DiegoAndai DiegoAndai closed this as not planned Won't fix, can't repro, duplicate, stale Nov 29, 2024
@DiegoAndai DiegoAndai added duplicate This issue or pull request already exists and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists package: icons Specific to @mui/icons
Projects
None yet
Development

No branches or pull requests

5 participants