Skip to main content

Python classnames

pypi python Build Status codecov

Utility to create CSS class strings from a multitude of values without poking around with string templates and lengthy logic.

This project is a Python porting of the JS library classnames

Show me the code!

pip install classnames
from classnames import class_names

# render_button() -> "btn btn--red"
# render_button(rounded=True) -> "btn btn--rounded btn--red"
def render_button(rounded: bool = False, color = "red"):
    class_names("btn", f"btn--{color}", {
        "btn--rounded": rounded
    })

Features

  • TODO

Credits

This package was created with Cookiecutter and the waynerv/cookiecutter-pypackage project template.

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

Unreleased

0.1.0 - 2022-11-04

  • initial release

Metadata

Release files for classnames 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for classnames 0.1.0
File Size Uploaded
classnames-0.1.0.tar.gz 6.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for classnames 0.1.0
File Interpreter ABI Platform
classnames-0.1.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 10.2 kB

Release files / classnames-0.1.0.tar.gz

Download URL classnames-0.1.0.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
9d69d34ba55ef75e88a42e881c069aed42cb351a28301f99cf539c7d1156906e
BLAKE2b-256 checksum
How to use checksums
c42150922c532fad8a96c70c88c358aa79daea49cbfcf9c818cf7d2666b75fb7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.4

Release files / classnames-0.1.0-py2.py3-none-any.whl

Download URL classnames-0.1.0-py2.py3-none-any.whl
Size 3.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
bc7827b7fbb9b0205e71d1968965b8ab67f3717b0079954a3b033ffe4aea9665
BLAKE2b-256 checksum
How to use checksums
17e37a115f1fc7e5d8c6d85c387df2ccb92e3e45b3530368eed07c31e7908652
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.4

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page