Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/Vepnar/Sanic-Sass

Implement Sass & SCSS to sanic
https://github.com/Vepnar/Sanic-Sass

python3 sanic sanic-framework sanic-middleware sass scss

Last synced: 30 days ago
JSON representation

Implement Sass & SCSS to sanic

Awesome Lists containing this project

README

        

# Sanic-sass 0.1.0

###### A simple and pythonic way to implement Sass & SCSS into Sanic without using webpack!

## Features
- On the fly compiling to speed up development with our middleware.
- Compile your entire application at once for at production

# Installation

## With pip
`pip install sanic-sass`

## With setuptools & git
Clone the newest version from github.

`git clone https://github.com/Vepnar/Sanic-Sass.git`

Cd into the new directory.

`cd Sanic-Sass`

Run setuptools.

`setup.py install --user`

# Examples

### Precompiled
```py
from sanic import Sanic
from sanic_sass import SassManifest

webserver = Sanic(name='precompiled')

manifest = SassManifest('/static/css', './static/sass', './compiled', css_type='sass')
manifest.compile_webapp(webserver, register_static=True)

webserver.run(host='0.0.0.0', port=8000)
```

### As middelware
```py
from sanic import Sanic
from sanic_sass import SassManifest

webserver = Sanic(name='middelware')

manifest = SassManifest('/static/css', './static/scss', './compiled', css_type='scss')
manifest.middelware(webserver)

webserver.run(host='0.0.0.0', port=8000, debug=True)
```