Skip to main content

High impact style sheets, empowered by python

Project description

Hyss - High Ympact Style Sheets

Rationale

Define styles as python dicts! All of the power of python, realised to create stylesheets. Coming soon to a package index near you!

Features

  • Create minified css content from a nested dictionary structure

  • Helper for compound css classes (think 'div p', 'main section')

Potential Future Features

  • Generate helpers for various css features. Already exist for animations.

  • Build an indenter for output css; ease of debugging for users

  • Means to convert

Usage Demonstrations

Here is a set of examples to illustrate the behaviour of functions within hyss

stylesheet(styles: dict) -> str

Takes a fractal dictionary structure and generates a minified css string as shown

from hyss import stylesheet

css = stylesheet(
        {
            'body': {
                'background-color': 'yellow',
            }, 
            'div': {
                'color': 'red'
            }
        }

print(css)

# This prints the following

# "body{background-color:yellow;}div{color:red;}"

with_linebreaks(css: str) -> str

Applies linebreaks to a minified css string, for debugging purposes as shown

from hyss.format import with_linebreaks

minified_css = "body{background-color:yellow;}div{color:red;}"

linebreak_css = with_linebreaks(minified_css)

print(linebreaks_css)

# This prints "body{\nbackground-color:yellow;\n}\ndiv{\ncolor:red;\n}\n"

In a file, linebreak_css will look as follows

body{
background-color:yellow;
}
div{
color:red;
}

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

hyss-2.0.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

hyss-2.0.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file hyss-2.0.0.tar.gz.

File metadata

  • Download URL: hyss-2.0.0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for hyss-2.0.0.tar.gz
Algorithm Hash digest
SHA256 9491ba38af3b35f109c9c1e1330ca5d39541a521a7e14ffaa13eb6e7b05316ea
MD5 ac2517b4ce61edb481c09d1c2b0d1607
BLAKE2b-256 d4415f3fb20391ba973ff67dff8ec31c9c87facada1c2b77e930acc7b32d6aa7

See more details on using hashes here.

File details

Details for the file hyss-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: hyss-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for hyss-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ef94c92cd1cb21e34b0180df426106d64fcfe5c60d45bf8c125150278fa07c4f
MD5 802321bac9d0a938cdb9506a29b87055
BLAKE2b-256 5f9d74f234424b6b4532f37a8f7291e80f2a9e4909d8ff904557fb4fb0cbb0d8

See more details on using hashes here.

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