Vepnar / Sanic-Sass

Implement Sass & SCSS to sanic

Home Page:https://pypi.org/project/sanic-sass/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

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

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)

About

Implement Sass & SCSS to sanic

https://pypi.org/project/sanic-sass/

License:MIT License


Languages

Language:Python 96.8%Language:SCSS 1.6%Language:Sass 1.5%