Skip to content

Instantly share code, notes, and snippets.

@norm
Created July 16, 2015 13:50
Show Gist options
  • Save norm/271bf72f77ae9df0fd9e to your computer and use it in GitHub Desktop.
Save norm/271bf72f77ae9df0fd9e to your computer and use it in GitHub Desktop.
Minimum Viable Python-only automatic SASS compilation
.PHONY: css
CSS=static/screen.css
css: $(CSS)
clean:
rm $(CSS)
$(CSS): static/%.css: sass/%.scss
python -mscss -t compressed -o $@ $<
sass: watchmedo tricks-from tricks.yaml
watchdog==0.8.3
pyscss==1.3.4
from watchdog.tricks import ShellCommandTrick
class MakeTrick(ShellCommandTrick):
def __init__(self, target=None, patterns=None):
make_command='make -B %s' % target
super(MakeTrick, self).__init__(
shell_command=make_command,
patterns=patterns,
wait_for_process=True,
)
tricks:
- tricks.MakeTrick:
target: 'css'
patterns: ['*.scss']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment