Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.
/ flask-sass Public archive
forked from weapp/flask-coffee2js

A small Flask extension that makes it easy to use Sass (SCSS) with your Flask application.

License

Notifications You must be signed in to change notification settings

imiric/flask-sass

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flask-sass

This project is not maintained and abandoned. Feel free to fork.

A small Flask extension that makes it easy to use Sass (SCSS) with your Flask application.

Why another one? Because Flask-Scss doesn't compile @imported files, and I liked the simple way flask-coffee2js compiled CoffeeScript files.

Code unabashedly adapted from https://github.com/weapp/flask-coffee2js.

Installation

Install with PIP

pip install git+https://github.com/imiric/flask-sass.git#egg=flask-sass

Usage

You can activate it by calling the sass function with your Flask app as a parameter:

  from flaskext.sass import sass
  sass(app, input_dir='assets/scss', output_dir='static/css')

This will intercept the request for output_dir/*.css and compile the file if it is necesary using the files from input_dir/*.scss.

When you deploy your app you might not want to accept the overhead of checking the modification time of your .scss and .css files on each request. A simple way to avoid this is wrapping the sass call in an if statement:

  if app.debug:
      from flaskext.sass import sass
      sass(app)

If you do this you'll be responsible for rendering the .scss files into .css when you deploy in non-debug mode to your production server.

About

A small Flask extension that makes it easy to use Sass (SCSS) with your Flask application.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • Python 100.0%