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

Missing icons #12251

Closed
xaviergonz opened this issue Jul 23, 2018 · 34 comments · Fixed by #17257
Closed

Missing icons #12251

xaviergonz opened this issue Jul 23, 2018 · 34 comments · Fixed by #17257
Labels
component: Icon The React component. external dependency Blocked by external dependency, we can’t do anything about it package: icons Specific to @mui/icons

Comments

@xaviergonz
Copy link
Contributor

xaviergonz commented Jul 23, 2018

There are SettingsApplication and lots of others, but plain "Settings" and variations are missing (it is listed on https://material.io/tools/icons/?icon=settings&style=baseline)

@mbrookes
Copy link
Member

mbrookes commented Jul 23, 2018

The problem is that the source icon is 20px instead of 24px. You can use SettingsOutlined or SettingsSharp which is the same icon at the correct size.

We could perhaps add a workaround to duplicate one of those paths to generate the "Filled" icon from.

For the full list of icons that have "incorrect" sizes, see: https://github.com/mui-org/material-ui/blob/master/packages/material-ui-icons/scripts/download.js#L19-L43

@oliviertassinari oliviertassinari added the component: Icon The React component. label Jul 23, 2018
@oliviertassinari
Copy link
Member

oliviertassinari commented Jul 23, 2018

The problem is that the source icon is 20px instead of 24px

Seriously, Google, why?

@9jaGuy
Copy link

9jaGuy commented Jul 24, 2018

by the way it is SettingsOutlined

@henrylearn2rock
Copy link

The lightbulb icon used on https://material-ui.com/ is also missing. Did Google get rid of it? Seriously? Not found anymore at https://material.io/tools/icons/

@oliviertassinari
Copy link
Member

@henrylearn2rock Yes, it's gone.

@sakulstra
Copy link
Contributor

FileUpload is gone as well^

@oliviertassinari
Copy link
Member

FileUpload is gone

@sakulstra I can only find CloudUpload.

@oliviertassinari oliviertassinari added the external dependency Blocked by external dependency, we can’t do anything about it label Jul 24, 2018
@durdenx
Copy link

durdenx commented Jul 24, 2018

and FileDownload too

@mbrookes
Copy link
Member

mbrookes commented Jul 24, 2018

@henrylearn2rock FWIW, the lightbulb icons are published in the @material-ui/docs package:

import LightbulbOutlineIcon from '@material-ui/docs/svgIcons/LightbulbOutline';
import LightbulbFullIcon from '@material-ui/docs/svgIcons/LightbulbFull';

But you might prefer to copy them locally. (Source here: https://github.com/mui-org/material-ui/tree/master/packages/material-ui-docs/src/svgIcons)

@henrylearn2rock
Copy link

@mbrookes thanks, I'll stay with 1.1.0. Hmmm... why would Google do that to screw us up.

@JeffBaumgardt
Copy link

I realize they made it a full semver major release so things are expected to break but they could have at least pointed to a list of changed icons that were already existing. I too ran into issues with the FileUpload and while it was a very easy fix it's still slightly annoying.

@oliviertassinari
Copy link
Member

oliviertassinari commented Jul 25, 2018

@JeffBaumgardt I wish we could have make a complete changelog, but with more than 1,000 icons, it's more efficient to offload the effort to our users with issues like this one. Thank you for reporting the pain point.

@mbrookes
Copy link
Member

mbrookes commented Jul 25, 2018

v1 icons not included in v2:

  • ContentCopy
  • ContentCut
  • ContentPaste
  • DoNotDisturb
  • DoNotDisturbAlt
  • DoNotDisturbOff
  • DoNotDisturbOn
  • FileDownload (available in @material-ui/docs/svgIcons)
  • FileUpload
  • InfoOutline
  • LabelOutline
  • LightbulbOutline (available in @material-ui/docs/svgIcons)
  • LockOutline
  • ModeEdit
  • SentimentNeutral
  • SimCardAlert
  • SystemUpdateAlt

v1 icons not included in v2 due to incorrect size (Use other styles):

  • Domain (filled)
  • Settings (filled)
  • Weekend (filled)

v2 icons not included due to incorrect size (Use other styles except for StarRate - use Star / StarBorder / StarHalf):

  • CastForEducation (filled)
  • Domain (filled)
  • PlayCircleFilledWhite (filled)
  • StarRate (filled)
  • StarRateOutlined
  • StarRateRound
  • StarRateTwotone
  • StarRateSharp

Edit @eps1lon: icons with strike-through are included in the latest version.

@meetbryce
Copy link

That would have been important to put in a changelog...

@mbrookes
Copy link
Member

@meetbryce I have added the list to the main PR, and updated the release notes & changelog.

@the-question
Copy link
Contributor

Just did my first PR (#12356) on Material-UI. I am not sure if I did it right or not. Please let me know if I need to adjust some things.

@the-question
Copy link
Contributor

BTW, as those are SVGs, we don't really care about the announced size, right?
If so, the size could be "hardcoded" to 24px in the saved file name as every one virtually is any size.

@oliviertassinari
Copy link
Member

oliviertassinari commented Aug 1, 2018

@the-question It's very brave from you to work on improve the fetch logic. Unfortunately, it won't help with #12251. The SvgIcon set the viewbox to 0 0 24 24. We need the source path to follow this same convention. Right now, I see 3 options:

  1. We wait for the google team to clean their svg images
  2. We find a tool to change the svg path bounding box
  3. We override the SvgIcon view box

I have sorted the options by my order of preference.

@the-question
Copy link
Contributor

I did a quick test with the Settings icon (baseline one, which is 20x20).
As SvgIcon sets the viewbox to [0, 0, 24, 24], and this case, where the original viewbox is [0, 0, 20, 20], we would need to move (translate) items in the SVG by 2px, so that they would be centered when the viewbox is set to [0, 0, 24, 24].

I applied the following transformation to the SVG (temp0 is the svg HTML node):

for(i = 0; i < temp0.children.length; i++) {
    temp0.children.item(i).setAttribute("transform", "translate(2, 2)")
}

This goes through every child of the parent svg element and moves them by 2px in each direction.

Therefore, when setting the viewbox to [0, 0, 24, 24], width and height to 24 afterward, the icon appears centered, but not zoomed, so the original look is preserved. (Using other width/height still works as expected)
You can try it with:

temp0.setAttribute("viewBox", [0, 0, 24, 24]);
temp0.setAttribute("height", 24);
temp0.setAttribute("width", 24);

Ideally, this (the first part, translating childrens) should be applied to the downloaded SVG, before saving it as a file.

P.S: I totally agree with your order of preference, but judging by the fact that they still link to a repository which is 3 years out of date, I'd say we may prefer taking the lead on this one.

@the-question
Copy link
Contributor

Just pushed 2fc0836 in #12356 to transform/scale SVGs on the fly.
The implementation is not the cleanest (uses .replace()), but it avoids adding new dependencies (e.g: cheerio) just to modify the SVG's content for (currently) 6 edge cases.

@bperel
Copy link

bperel commented Aug 23, 2018

@mbrookes Could you mention that FileUpload is missing as well ?

@mbrookes
Copy link
Member

@bperel thanks - must have somehow missed that in the diff.

@aommm
Copy link

aommm commented Aug 29, 2018

Thanks for that list @mbrookes !
I ran into problems with a missing FileDownload icon when upgrading @material-ui/icons version. I found that the icon was renamed to GetApp.
capture d ecran 2018-09-12 a 17 28 23

I wonder, where is the changelog located? When upgrading, I checked https://github.com/mui-org/material-ui/releases , but there is nothing mentioned there about a v2 release or about missing icons.

@yeahoffline
Copy link

@material-ui/icons 1.0.0 + @material-ui/core 3.1.0 seems to work...

@mbrookes
Copy link
Member

@eps1lon
Copy link
Member

eps1lon commented Jun 28, 2019

Looked through #12251 (comment) and checked if the icons not included due to size are now included. The following icons are included in the latest version:

  • PlayCircleFilledWhite (filled)
  • StarRateOutlined
  • StarRateRound
  • StarRateTwotone
  • StarRateSharp

@oliviertassinari oliviertassinari changed the title [Icon v2] Settings icon is missing Missing icons Aug 31, 2019
@oliviertassinari
Copy link
Member

oliviertassinari commented Aug 31, 2019

The eco icons is missing, https://material.io/resources/icons/?search=eco&style=baseline, as reported in #17251. We should be able to manually patch this one.

@colemars
Copy link
Contributor

colemars commented Aug 31, 2019

Another point of discrepancy here seems to be that google's icon json isn't up to date with material.io's list of icons.

@colemars
Copy link
Contributor

colemars commented Aug 31, 2019

@oliviertassinari Regarding the manual patch -- currently if the icons script were to be ran after the patch is committed it would remove the patch (because the script references the out of date json).

However, it seems other parts of the script are broken as well (404 errors with the current URL path) so can we assume it will be altered in the future before it is ran again? Or at least until google updates there JSON.

@mbrookes
Copy link
Member

mbrookes commented Sep 1, 2019

@colemars Here you go: https://fonts.google.com/metadata/icons

The json structure has changed though, so you'll have to tweak the script a bit.

Also the download URLs are now of the form:

https://fonts.gstatic.com/s/i/materialicons/3d_rotation/v1/24px.svg
https://fonts.gstatic.com/s/i/materialiconsoutlined/3d_rotation/v1/24px.svg
https://fonts.gstatic.com/s/i/materialiconsround/3d_rotation/v1/24px.svg
https://fonts.gstatic.com/s/i/materialiconstwotone/3d_rotation/v1/24px.svg
https://fonts.gstatic.com/s/i/materialiconssharp/3d_rotation/v1/24px.svg

(Note "round" not "rounded")

@michael-land
Copy link
Contributor

michael-land commented Sep 5, 2019

Missing icon.

import StorefrontIcon from '@material-ui/icons/Storefront';

{
  "name": "storefront",
  "version": 1,
  "unsupported_families": [],
  "categories": [
    "places"
  ],
  "tags": []
},

@oliviertassinari
Copy link
Member

oliviertassinari commented Sep 5, 2019

@xiaoyu-tamu Storefront will be in the next release: @material-ui/[email protected].

@agroves333

This comment has been minimized.

@dennisat
Copy link

I found one here https://iconify.design/icon-sets/mdi/google.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: Icon The React component. external dependency Blocked by external dependency, we can’t do anything about it package: icons Specific to @mui/icons
Projects
None yet
Development

Successfully merging a pull request may close this issue.