-
Notifications
You must be signed in to change notification settings - Fork 60
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
Is there a plan to add material design inline icons? #36
Comments
Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗 |
Heya! Thanks, the themes looking good 👌 I've been playing around making React sites with https://mui.com, so certainly appreciate the materials styling Yeh, I guess if you could "compile" them into a similar JSON format to: https://github.com/executablebooks/sphinx-design/blob/main/sphinx_design/compiled/octicons.json? |
Otherwise, I could easily write a script that translates the SVGs from XML form into an aggregated JSON file. |
ok I've put together a python script that "walks" the src folder (copied from google/material-design-icons repo) and dumps the SVG data into several JSON files. Each JSON file has a collection of icons specific to a material icon "theme" (regular, outlined, sharp, rounded, & twotone). Attached is a zip of the src SVG files along with the compiled JSON files and the python script that generates the JSON files from the src SVG assets. I've been considering making a repo to automate this task for any future updates to the google/material-design-icons repo, but I'd like to know if this approach works at all first. Hint: if you update the SVG assets in the src folder, then all you need to do is re-run the walk_svg_to_json.py script (which will update the JSON files in the compiled folder). Additional ContextSome SVG assets use more than just a Unlike the sample you linked to for the octicons.json, there are no closing
|
SuccessI managed to get this working! I had to update the json from the google/material-icons repo's latest commit. Some icons seem to have been added since the last release; these new icons show on the material design site's list of material icons, but they aren't included in the latest release assets 😕. Here's a screenshot of the new roles being used in the sphinx-immaterial theme's docs They also work seemlessly (without extra css from the theme's docs' build config) in the light theme FYI: the source snippet for the above screenshots is Options must be `any of the icons bundled with this theme <https://github.com/squidfunk/mkdocs-material/tree/master/material/.icons>`_.
Popular combinations are
.. csv-table::
:material-outlined:`toggle_off;1.5rem` ``material/toggle-switch-off-outline``, :material-regular:`toggle_on;1.5rem` ``material/toggle-switch``
:material-outlined:`light_mode;1.5rem` ``material/weather-sunny``, :material-outlined:`dark_mode;1.5rem` ``material/weather-night``
:material-outlined:`visibility;1.5rem` ``material/eye-outline``, :material-regular:`visibility;1.5rem` ``material/eye``
:material-outlined:`lightbulb;1.5rem` ``material/lightbulb-outline``, :material-regular:`lightbulb;1.5rem` ``material/lightbulb`` PR coming shortly. |
awesome 😄 |
I thought I'd ask this here since you're moving away from sphinx-panels - this is looking great BTW!
I see that there are inline icons for FontAwesome and Octicon. I'm helping develop a port of mkdocs-material theme to sphinx, and our docs could use the set of inline icons from the material design set.
For reference
ps - If you're curious to see the sphinx-immaterial theme in action, it is hosted on gh-pages. I've also made sure it works rather well with RTD builds 😉 .
The text was updated successfully, but these errors were encountered: