Skip to main content

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

Release files for hyss 2.0.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 hyss 2.0.0
File Size Uploaded
hyss-2.0.0.tar.gz 3.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hyss 2.0.0
File Interpreter ABI Platform
hyss-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 8.5 kB

Release files / hyss-2.0.0.tar.gz

Download URL hyss-2.0.0.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9491ba38af3b35f109c9c1e1330ca5d39541a521a7e14ffaa13eb6e7b05316ea
BLAKE2b-256 checksum
How to use checksums
d4415f3fb20391ba973ff67dff8ec31c9c87facada1c2b77e930acc7b32d6aa7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.0

Release files / hyss-2.0.0-py3-none-any.whl

Download URL hyss-2.0.0-py3-none-any.whl
Size 4.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ef94c92cd1cb21e34b0180df426106d64fcfe5c60d45bf8c125150278fa07c4f
BLAKE2b-256 checksum
How to use checksums
5f9d74f234424b6b4532f37a8f7291e80f2a9e4909d8ff904557fb4fb0cbb0d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.0

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

1.0.0

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