Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for SASS (and other CSS preprocessors) #22

Open
bryanveloso opened this issue Jan 20, 2011 · 1 comment
Open

Support for SASS (and other CSS preprocessors) #22

bryanveloso opened this issue Jan 20, 2011 · 1 comment

Comments

@bryanveloso
Copy link

django-css handles this quite well by having a COMPILER_FORMATS setting that points to the binary of the preprocessor you want to use.

COMPILER_FORMATS = {
    '.sass': {
        'binary_path':'sass',
        'arguments': '*.sass *.css'
    }
}

It then tries to find stylesheets with those extensions (usually within {% compress %} blocks).

There are many ways I think CSS preprocessors would fit within this project, one of them being to allow SASS to be used only for "development mode" and when the management command is used, process them and throw them on the server. django-css currently compresses everything that falls in between the {% compress %} block and then caches the link to the static file, even when working with CDNs.

Really, I just want to use SASS. :)

@jcarbaugh
Copy link
Contributor

Hey there! It's taken me a while to get around to this. I've spoken with various people that use SASS on how they would see it fitting into mediasync. I just pushed a feature that, I believe, reflects their usage fairly well.

mediasync now has a pre_sync signal that is sent and a method that can be connected to it to run the SASS command on any scss and sass file in STATIC_ROOT. That should compile everything when the syncmedia management command is called. I'm not going to try to do anything special while developing since the sass --watch command should take care of that. It's all documented in the README under Signals.

Again, I don't use SASS myself, so I'm not sure if this is the best approach. If you or anyone else could try it and give feedback, it'd be much appreciated. I'll leave this issue open until I hear feedback on actual usage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants