Skip to main content

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 %}

{% 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

Download files

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

Source Distribution

django-classnames-tag-0.2.tar.gz (2.5 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page