Giter Club home page Giter Club logo

wagtailextraicons's Introduction

Wagtail Extra Icons

Add extra icons to your Wagtail project.

Versions

Version 3.X.X

Is for use with Wagtail versions 3.0 and above. This uses Wagtail's updated module paths from version 3.0.

Version 2.X.X

Is for use with Wagtail versions 2.15 and above. This version uses wagtail's new Svg icon system.

This version works with Wagtail versions 3.0 and 4.*, but is deprecated for those.

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')),
    ],
    use_json_field=True,    
)

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

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.txt file for details.

wagtailextraicons's People

Contributors

eug3nix avatar siburg avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.