Add extra icons to your Wagtail project.
Project description
Wagtail Extra Icons
Add extra icons to your Wagtail project.
Versions
Version 2.X.X
Is for use with Wagtail versions 2.15 and above. This version uses wagtail's new Svg icon system.
Version 1.X.X
Is for use with Wagtail versions below 2.15. This version uses wagtail's old Icon font system.
Install
pip install wagtailextraicons
Then add wagtailextraicons
to your installed apps:
INSTALLED_APPS = [
...
'wagtailextraicons'
]
Usage
The full list of icons is available at docs/icons.md.
All icons are namespaced as extraicons--
to avoid clashing with existing Wagtail icons. You can add the extra icons to
your StreamField blocks like any other:
content = StreamField([
(
'paragraph',
blocks.RichTextBlock(icon='extraicons--paragraph')
),
])
You can also add the extra icons to your own custom StructBlock
classes:
class PersonBlock(blocks.StructBlock):
person = SnippetChooserBlock('app.Person')
text = blocks.RichTextBlock()
class Meta:
icon = 'extraicons--person'
Reference the Wagtail docs for all the ways to include icons.
Authors
- Sam Costigan Octave
Contributing
The icon fonts are compiled from the list of SVG files in static_src/wagtailextraicons/extraicons. This makes it very easy to add new icons. All that's needed is an appropriate SVG file, so pull requests with new icons are always welcome. There are a few constraints on the icons however:
- The icons must fit within their view box. Icons which don't will cause the fonts view box to have negative values, which results in invalid .ttf and .woff files.
- Try to avoid using strokes, rects, etc. in your SVG. Some of these may work, but plain paths will always work, so prefer paths where possible.
- Don't set colours on your SVG.
Code pull requests are also welcome.
License
This project is licensed under the BSD License - see the LICENSE.md file for details
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for wagtailextraicons-2.0.0a0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | aef1a9ed82632e3e8247aca245f1ce0b5d9b594c243c340765cd01fb98396081 |
|
MD5 | 01588a92111d681044cb3b74faed3b9c |
|
BLAKE2b-256 | c67db3a445a9805c5a910b7edafd8d804d0cb5cf5a54bb766cc22cc0b03cf7bb |
Hashes for wagtailextraicons-2.0.0a0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 968f2cd83802cc8f89e1ef2027a93d53e8f8e0dc8115a3fdebfbead3f16c8462 |
|
MD5 | 6d3e53ad09d0946dcf50e937bcf0615f |
|
BLAKE2b-256 | 1ea4c2d50346aa14b028f279b6a40c58d7629f14ff01290cc273963f7c18770a |