From 619f3959802fcaf364f2867a2d18e236ad9a250e Mon Sep 17 00:00:00 2001 From: Coen van der Kamp Date: Fri, 10 Feb 2023 08:22:45 +0100 Subject: [PATCH] Add new "Icons" page for icons customisation and reuse across the admin interface (#6028) Co-authored-by: Thibaud Colas --- CHANGELOG.txt | 1 + docs/advanced_topics/icons.md | 82 ++++++++++++++++++++++++++++ docs/advanced_topics/index.md | 1 + docs/extending/extending_draftail.md | 2 + docs/releases/5.0.md | 1 + 5 files changed, 87 insertions(+) create mode 100644 docs/advanced_topics/icons.md diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 56010647c3..4773b37dd4 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -10,6 +10,7 @@ Changelog * Fix: Ensure `label_format` on StructBlock gracefully handles missing variables (Aadi jindal) * Fix: Adopt a no-JavaScript and more accessible solution for the 'Reset to default' switch to Gravatar when editing user profile (Loveth Omokaro) * Docs: Add code block to make it easier to understand contribution docs (Suyash Singh) + * Docs: Add new "Icons" page for icons customisation and reuse across the admin interface (Coen van der Kamp) * Maintenance: Update djhtml (html formatting) library to v 1.5.2 (Loveth Omokaro) * Maintenance: Re-enable `strictPropertyInitialization` in tsconfig (Thibaud Colas) * Maintenance: Refactor accessibility checker userbar item (Albina Starykova) diff --git a/docs/advanced_topics/icons.md b/docs/advanced_topics/icons.md new file mode 100644 index 0000000000..c6bc5d53dc --- /dev/null +++ b/docs/advanced_topics/icons.md @@ -0,0 +1,82 @@ +(icons)= + +# Icons + +Wagtail comes with an SVG icon set. The icons are used throughout the admin interface. + +Elements that use icons are: + +- [Register Admin Menu Item](register_admin_menu_item) +- [Client-side components](extending_clientside_components) +- [Rich text editor toolbar buttons](extending_the_draftail_editor) +- [ModelAdmin menu](modeladmin_menu_icon) +- [StreamField blocks](custom_streamfield_blocks) + +This document describes how to choose, add and customise icons. + +## Available icons and their names + +An icon name corresponds with the value of `id` in the SVG file: ` + + + + +``` + +The `svg` tag should: + +- Set the `id="icon-"` attribute, icons are referenced by this name +- Set the `xmlns="http://www.w3.org/2000/svg"` attribute +- Set the `viewBox="..."` attribute +- Include license information, if applicable. + +Set `/templates/wagtailadmin/icons/`. diff --git a/docs/advanced_topics/index.md b/docs/advanced_topics/index.md index f9b04d8e12..94a49c45cc 100644 --- a/docs/advanced_topics/index.md +++ b/docs/advanced_topics/index.md @@ -6,6 +6,7 @@ maxdepth: 2 --- images/index documents/index +icons embeds add_to_django_project deploying diff --git a/docs/extending/extending_draftail.md b/docs/extending/extending_draftail.md index dc7597956d..68decb7c24 100644 --- a/docs/extending/extending_draftail.md +++ b/docs/extending/extending_draftail.md @@ -1,3 +1,5 @@ +(extending_the_draftail_editor)= + # Extending the Draftail Editor Wagtail’s rich text editor is built with [Draftail](https://www.draftail.org/), and its functionality can be extended through plugins. diff --git a/docs/releases/5.0.md b/docs/releases/5.0.md index ce3aebcc74..e5ccde3b4f 100644 --- a/docs/releases/5.0.md +++ b/docs/releases/5.0.md @@ -27,6 +27,7 @@ depth: 1 ### Documentation * Add code block to make it easier to understand contribution docs (Suyash Singh) + * Add new "Icons" page for icons customisation and reuse across the admin interface (Coen van der Kamp) ### Maintenance