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 features such as keyframe animations.

  • Create a means of generating individual styles to be scoped to specific element tags, akin to how style sheets function in many css-in-js libraries

Usage Demonstration

The most basic function is stylesheet(), which takes a structure such as that shown and creates minified css. For ease of debugging, a second value False can be passed to the function to generate a more readable format.

    # Basic stylesheet definition  

    stylesheet(
        {
            'body': {
                'background-color': 'yellow',
            }, 
            'div': {
                'color': 'red'
            }
        }
    ) => 'body{background-color:yellow;}div{color:red;}'

    # Debugging
    
    stylesheet(
        {
            'body': {
                'background-color': 'yellow',
            }, 
            'div': {
                'color': 'red'
            }
        },
	minify = False
    ) => 'body{
    	  background-color:yellow;
	  }
	  div{
	  color:red;
	  }'

    # This isn't intended for production use, but may be useful
    # for debugging purposes (especially in finding or examining novel problems/challenges)

Further tutorials and a full reference are TODO

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-1.0.0.tar.gz (3.6 kB view hashes)

Uploaded Source

Built Distribution

hyss-1.0.0-py3-none-any.whl (4.3 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