aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2016-06-07 10:34:17 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2016-06-07 10:34:17 +0100
commit5fd582ebc56804df7dd7ada003846b6ae55f606b (patch)
tree5dbaf860c21c0b29d772de09dcae9fdce15b0966
parent4fa84d0faa5505f53bc24b75628ab883b35ad299 (diff)
Add output style option to make_css command.
-rwxr-xr-xbin/make_css11
1 files changed, 10 insertions, 1 deletions
diff --git a/bin/make_css b/bin/make_css
index a98dc6bba..5844579a7 100755
--- a/bin/make_css
+++ b/bin/make_css
@@ -24,7 +24,15 @@ use Pod::Usage;
# Store ARGV in case we need to restart later.
my @ARGVorig = @ARGV;
+my %styles = (
+ nested => SASS_STYLE_NESTED,
+ expanded => SASS_STYLE_EXPANDED,
+ compact => SASS_STYLE_COMPACT,
+ compressed => SASS_STYLE_COMPRESSED,
+);
+my $style = 'compressed';
GetOptions(
+ 'style|t=s' => sub { die "Unknown style\n" unless $_[1] =~ /nested|expanded|compact|compressed/; $style = $_[1]; },
'verbose' => \my $verbose,
'watch' => \my $watch,
'help|?' => \my $help,
@@ -34,7 +42,7 @@ pod2usage(1) if $help;
my $mime_types = MIME::Types->new;
my $sass = CSS::Sass->new(
- output_style => SASS_STYLE_COMPRESSED,
+ output_style => $styles{$style},
dont_die => 1,
sass_functions => {
'inline-image($url)' => sub {
@@ -142,6 +150,7 @@ make_css [options] [dirs ...]
Options:
--verbose display more information
--watch wait for file updates and compile automatically
+ --style, -t CSS output style (one of nested, expanded, compact, compressed)
--help this help message
If no directories are specified, any .scss files under web/ that do not begin