|
@@ -89,3 +89,20 @@ First think of how to name the controller. Keep it concise, one or two words ide
|
|
|
This is an area of active improvement for Wagtail, with [ongoing discussions](https://github.com/wagtail/wagtail/discussions/8017).
|
|
|
|
|
|
- Always use the `trimmed` attribute on `blocktranslate` tags to prevent unnecessary whitespace from being added to the translation strings.
|
|
|
+
|
|
|
+## SVG icons
|
|
|
+
|
|
|
+We use inline SVG elements for Wagtail’s icons, for performance and so icons can be styled with CSS. View [](icons) for information on how icons are set up for Wagtail users.
|
|
|
+
|
|
|
+### Adding icons
|
|
|
+
|
|
|
+Icons are SVG files in the [Wagtail admin template folder](https://github.com/wagtail/wagtail/tree/main/wagtail/admin/templates/wagtailadmin/icons).
|
|
|
+
|
|
|
+When adding or updating an icon,
|
|
|
+
|
|
|
+1. Run it through [SVGO](https://jakearchibald.github.io/svgomg/) with appropriate compression settings.
|
|
|
+2. Manually remove any unnecessary attributes.
|
|
|
+3. Manually add its `id` attribute with a prefix of `icon-` and the icon name matching the file name.
|
|
|
+4. Keep the icon as named from its source if possible, and leave the licensing information in the SVG file if there is any.
|
|
|
+5. Add the icon to Wagtail’s own implementation of the `register_icons` hook, in alphabetical order.
|
|
|
+6. Go to the styleguide and copy the Wagtail icons table according to instructions in the template, pasting the result in `wagtail_icons_table.txt`.
|