Django templatetags for GitHub's Octicons.
Project description
django-octicons
Template tags for Django to use GitHub Octicons.
Installation
Grab it from PyPI using pipenv (or pip):
$ pipenv install django-octicons
Install the app in your project:
# settings.py
INSTALLED_APPS = [
# other apps
'octicons.apps.OcticonsConfig'
]
Usage
Load the tag library in your HTML template:
{% load octicons %}
And then, you can use the icons like this:
<a class="btn btn-sm" href="#url" role="button">
{% octicon "eye" %}
Watch
</a>
You can also pass any required attributes:
<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:
.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
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
django-octicons-1.0.1.tar.gz
(29.6 kB
view details)
Built Distribution
File details
Details for the file django-octicons-1.0.1.tar.gz
.
File metadata
- Download URL: django-octicons-1.0.1.tar.gz
- Upload date:
- Size: 29.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a48ae61fb1e5e326f87196d04cb52c77736671372ca8a67c963294ca4cae3fd |
|
MD5 | bcafdf1d7e645ae99551113d092d0fe5 |
|
BLAKE2b-256 | 5f55028070ab72e9d57d0e053d9d63da3f5f7de4f8703a0d6d3ab39827371fc4 |
File details
Details for the file django_octicons-1.0.1-py2.py3-none-any.whl
.
File metadata
- Download URL: django_octicons-1.0.1-py2.py3-none-any.whl
- Upload date:
- Size: 28.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ac89754308eaaae4cadf782d8773080e5cb4095f03be91af2f424d018fcb3db |
|
MD5 | 17fda908ee35a999eb51fdc743dd5746 |
|
BLAKE2b-256 | c7eccfc89c829f8b77694d9af3195444444e63643e256aa9d924b1308bf78d0a |