Skip to main content

Django templatetags for GitHub's Octicons.

Project description


# django-octicons

[![Build Status](https://travis-ci.org/sanketsaurav/django-octicons.svg?branch=master)](https://travis-ci.org/sanketsaurav/django-octicons)

Template tags for Django to use [GitHub Octicons](https://octicons.github.com/).

## Installation

Grab it from PyPI using pipenv (or pip):

```sh
$ pipenv install django-octicons
```

Install the app in your project:

```python
# settings.py

INSTALLED_APPS = [
# other apps
'octicons.apps.OcticonsConfig'
]
```

## Usage

Load the tag library in your HTML template:

```html
{% load octicons %}
```

And then, you can use the icons like this:

```html
<a class="btn btn-sm" href="#url" role="button">
{% octicon "eye" %}
Watch
</a>
```

You can also pass any required attributes:

```html
<a class="btn btn-sm" href="#url" role="button">
{% octicon "thumbsup" height="60" class="large" %}
Confirm Purchase
</a>
```

All attributes passed will be added as HTML attributes to the SVG element
of the icon.

### Styling

You should add the following in your styles:

```css
.octicon {
display: inline-block;
vertical-align: text-top;
fill: currentColor;
}
```

The class `octicon` will be present in all icons. You are free to style it however you want.


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-octicons-1.0.0.tar.gz (29.5 kB view hashes)

Uploaded Source

Built Distribution

django_octicons-1.0.0-py2.py3-none-any.whl (28.8 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page