Django classnames template tag
Project description
# Django Classnames Tag
Provides a template tag to create css classnames easily.
Inspired by JedWatson/classnames
## Installation
```
$ pip install django-classnames-tag
```
Add the app to INSTALLED_APPS:
```
INSTALLED_APPS += ['django_classnames_tag']
```
## Usage
```
{% classnames <classname>=<bool> <classname>=<value>|eq:3 <classname>=<value>|lte:2 %}
```
Example:
```
{% load classnames %}
<a class="{% classnames success=obj.percentage|gte=90 danger=obj.percentage|lte:10 %}">...</a>
```
There are a bunch of helper filters available:
```
lte, lt, eq, gt, gte
```
Provides a template tag to create css classnames easily.
Inspired by JedWatson/classnames
## Installation
```
$ pip install django-classnames-tag
```
Add the app to INSTALLED_APPS:
```
INSTALLED_APPS += ['django_classnames_tag']
```
## Usage
```
{% classnames <classname>=<bool> <classname>=<value>|eq:3 <classname>=<value>|lte:2 %}
```
Example:
```
{% load classnames %}
<a class="{% classnames success=obj.percentage|gte=90 danger=obj.percentage|lte:10 %}">...</a>
```
There are a bunch of helper filters available:
```
lte, lt, eq, gt, gte
```
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
Close
Hashes for django-classnames-tag-0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65943abb940222404a790ab2e186abed05ea57e2745e37c4bf2941476b73aace |
|
MD5 | 2a52641d6c7bad52165f69be3d6949ca |
|
BLAKE2b-256 | e7c2de6c2813915a564fac0a1a68c6f596c76116b191224729789b875e96b905 |