Custom Icons: size and color info missing in documtation #7173
-
DescriptionI have added custom icons and had/have some struggles. Custom Icons as in: made by myself. Not other sets. In the navigation they pushed away the text besides them: I figured out that the svg need to be smaller. I couldnt find what size they need to be. I made them smaller and smaller until they worked. Next (still unsolved) problem: what color should they have so that the color is adjusted depending on context? So for exmaple that they fit in when in a link. Related linksI used this guide: https://squidfunk.github.io/mkdocs-material/setup/changing-the-logo-and-icons/#additional-icons Proposed changeAdd the specs that a custom icon needs to be in the documetation:
Before submitting
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
I'm converting this to a discussion, so the community can help you with your customization. We're currently not considering making our icon customization guide more complex. However, if we can make it easier with a few sentences, feel free to open a PR. |
Beta Was this translation helpful? Give feedback.
-
Huh, weird I'm pretty sure I sent a comment in the Issue, but now I don't see it 🤔, perhaps I forgot to press send 😰 Let's take a random SVG from the theme and open it up in a text editor: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 2a2 2 0 0 0-2 2v8h2V8h2v4h2V4a2 2 0 0 0-2-2H4m0 2h2v2H4m18 9.5V14a2 2 0 0 0-2-2h-4v10h4a2 2 0 0 0 2-2v-1.5a1.54 1.54 0 0 0-1.5-1.5 1.54 1.54 0 0 0 1.5-1.5M20 20h-2v-2h2v2m0-4h-2v-2h2M5.79 21.61l-1.58-1.22 14-18 1.58 1.22Z"/></svg> We can see the icon is set to a size of 24x24, all of the values in the path in the |
Beta Was this translation helpful? Give feedback.
Huh, weird I'm pretty sure I sent a comment in the Issue, but now I don't see it 🤔, perhaps I forgot to press send 😰
Let's take a random SVG from the theme and open it up in a text editor:
We can see the icon is set to a size of 24x24, all of the values in the path in the
d
attribute …