A small Flask extension that makes it easy to use Stylus with your Flask application.
Usage
You can activate it by calling the stylus2css function with your Flask app as a parameter:
from flaskext.stylus2css import stylus2css stylus2css(app, css_folder=’css’, stylus_folder=’src/stylus’)
This will intercept the request to css_folder and compile de file if is necesary using the files from stylus_folder.
When you deploy your app you might not want to accept the overhead of checking the modification time of your .stylus and .css files on each request. A simple way to avoid this is wrapping the stylus2css call in an if statement:
- if app.debug:
from flaskext.stylus2css import stylus2css stylus2css(app)
If you do this you’ll be responsible for rendering the .stylus files into .css when you deploy in non-debug mode to your production server.
Release files for flask-stylus2css 0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| flask-stylus2css-0.1.zip | 5.8 kB | Details |
Release files / flask-stylus2css-0.1.zip
| Download URL | flask-stylus2css-0.1.zip |
|---|---|
| Size | 5.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
068d9e16ad938be437240696aa0a7e67901978ef6ee0fd0808e31ea2f904f9bd
|
|
BLAKE2b-256 checksum How to use checksums |
64e37ceac959b23c72b00de06b3fd0f722623821e91cca060aa4d1613657e2cd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |