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

Feat/update angular and nest icons #2314

Merged
merged 3 commits into from May 9, 2024
Merged

Conversation

PKief
Copy link
Owner

@PKief PKief commented May 5, 2024

Making use of the new API for cloning existing icons to replicate them.

Preview looks like that (so remains the same, but based on a single SVG file):

Angular
angular-file-changes

Nest
nest-file-changes

@PKief PKief self-assigned this May 5, 2024
@PKief PKief merged commit 0a0a3a0 into main May 9, 2024
4 of 6 checks passed
@PKief PKief deleted the feat/update-angular-and-nest-icons branch May 9, 2024 18:17
Copy link

github-actions bot commented May 9, 2024

Merge Successful

Thanks for your contribution! 🎉

The changes will be part of the upcoming update on the marketplace.

@devuco
Copy link

devuco commented May 10, 2024

Hello 👋

I have a question.
How do I use the nest icons because whenever I create a service or module file in my nest project, it shows angular icons only?

Thank You

@PKief
Copy link
Owner Author

PKief commented May 10, 2024

@devuco you have to update your user settings like that:

{
  "material-icon-theme.activeIconPack": "nest",
}

Or simply run the following command and select "Nest":

image

@devuco
Copy link

devuco commented May 10, 2024

@devuco you have to update your user settings like that:

{
  "material-icon-theme.activeIconPack": "nest",
}

Or simply run the following command and select "Nest":

image

Thank You
Works like a charm 💯

@nowlena
Copy link

nowlena commented May 10, 2024

It looks like my file associations to the cloned icons no longer show:

  "material-icon-theme.activeIconPack": "nest",
  "material-icon-theme.files.associations": {
    "*.type.ts": "nest-controller",
    "*.utils.ts": "nest-decorator"
  },

my file.type.ts and file.utils.ts files now have no icon

@PKief
Copy link
Owner Author

PKief commented May 11, 2024

@nowlena You're right. We allowed us to change the API with the last update to introduce a new clone API. That means that there's no nest-controller SVG icon existing anymore. Instead of that you have to clone the existing nest SVG icon and add some color to it like that:

  "material-icon-theme.files.customClones": [
    {
      "name": "nest-controller",
      "base": "nest",
      "color": "light-blue-700",
      "fileExtensions": ["type.ts"]
    },
    {
      "name": "nest-decorator",
      "base": "nest",
      "color": "purple-400",
      "fileExtensions": ["utils.ts"]
    }
  ]

Then it should work as before:

image

The advantages of that is, that you are not depending on any existing colors anymore but can choose any color that you want for your icons. Here you can find a list of the available colors of the Material Design palette: https://github.com/PKief/vscode-material-icon-theme/blob/main/src/icons/generator/clones/utils/color/materialPalette.ts

You can find more information about the clone feature in our documentation:
https://github.com/PKief/vscode-material-icon-theme?tab=readme-ov-file#custom-clones

@lucas-labs
Copy link
Contributor

@PKief maybe we could find a way to make material-icon-theme.files.associations also work with icons cloned by the extension itself, and avoid breaking current users config. If that's ok with you, I could take some time, it shouldn't be too hard to implement.

Oh, completely unrelated: I noticed the new svgo action removes the mit-no-recolor attr from the svg files (the attribute that made parts of some icon impossible to recolor in edge cases). I'm not too familiar with svgo but I saw it works with plugins and one can create custom plugins. So maybe that's the way to go. But I haven't gotten too much into it just yet. I'll keep you posted :)

@PKief
Copy link
Owner Author

PKief commented May 11, 2024

@lucas-labs Yeah that would be nice, because I think there might be other users as well where it might have broken some configurations. If you like you can analyze this.

Ah okay, that's unfortunate that svgo removes the attribute. Good that you found that out! I just reverted the removal of the "mit-no-recolor" attribute so that these are still there. Yeah with some plugins it should work. We should figure this out, because svgo is a nice way to optimize the icons.

@PKief
Copy link
Owner Author

PKief commented May 11, 2024

@lucas-labs I think I've found a solution for the removal of our attribute: #2322

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

Successfully merging this pull request may close these issues.

None yet

4 participants