Skip to content

lucafaggianelli/python-classnames

Repository files navigation

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.

About

Utility to generate CSS class strings from a multitude of inputs without headaches

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published