Skip to main content

CSS generator for Python

Project description

- AthenaCSS -

pypi GitHub license Discord Downloads


Package Details

Details and features

  • A Python package which allows CSS to be written as a Python script
  • CSS output to file, string or console from the Python script

Python Version

  • Supported Python versions: 3.10
    • Other older versions of Python are not currently supported.
    • These older versions will probably not be supported by @AndreasSas himself, but if you want to contribute to the project and make this package compatible with older versions of Python, Pull requests are always welcome.

Quick Examples

The following example is only a very small CSS code piece, but should bring the idea across of how it works.

from AthenaCSS import *
from AthenaColor import RGB # Dependecy on own other package

with (css_generator := CSSGenerator()) as generator:
    with (rule0 := CSSRule()) as (selector, declaration):
        selector.add(
            SelectorElement.H1(CSSClass("title")),
        )
        declaration.add(
            Property.Color(RGB(128,64,32)),
        )
    generator.add_comment(
        "The following sets the Header with the class of 'title' to have a specific color"
    ).add_rule(
        rule0
    )
css_generator.to_console()

The above code will output the following CSS to the console:

/*The following sets the Header with the class of 'title' to have a specific color*/
h1.title {
    color: rgb(128, 64, 32);
}

Documentation

Full documentation can be found at: directiveathena.com (redirect to Obsidian.md publish site) (Reminder, the documentation is still under heavy development)


Install

To install the package in your Python environment

pip install AthenaCSS --upgrade

Links

Project files can be found at:


Disclaimer

With No Dependency, the standard library is not counted as a dependency


Made By Andreas Sas, 2022

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

AthenaCSS-0.8.0.tar.gz (18.5 kB view hashes)

Uploaded Source

Built Distribution

AthenaCSS-0.8.0-py3-none-any.whl (17.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page