Skip to content

Commit

Permalink
Move processing of non-less files into style.less
Browse files Browse the repository at this point in the history
and move user.css into login.less
  • Loading branch information
ranguard committed May 27, 2015
1 parent 8be6769 commit 4f3520c
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 13 deletions.
7 changes: 5 additions & 2 deletions lib/MetaCPAN/Web/Controller/Assets.pm
Expand Up @@ -36,8 +36,11 @@ sub css : Path('style.css') : Args(0) {
my $less = `lessc -v`;
croak(q{Can't find lessc command}) unless $less;

my @cmd
= ( 'lessc', '--include-path=root/static/less:root/static/', $file );

my ( $stdout, $stderr, $exit ) = capture {
system( 'lessc', $file );
system(@cmd);
};
die $stderr if $stderr;

Expand All @@ -50,7 +53,7 @@ sub css : Path('style.css') : Args(0) {

# Make sure the user re-requests each time
$c->res->header( 'Cache-Control' => 'max-age=0, no-store, no-cache' );
$c->res->body($stdout);
$c->res->body( CSS::Minifier::XS::minify($stdout) );

}
else {
Expand Down
9 changes: 0 additions & 9 deletions root/static/css/user.css

This file was deleted.

12 changes: 11 additions & 1 deletion root/static/less/login.less
Expand Up @@ -10,4 +10,14 @@
float: left;
font-size: 2.7em;
}
}
}

/* Specific css for User actions */

.logged_in {
display: none;
}

.logged_out {
display: none;
}
8 changes: 7 additions & 1 deletion root/static/less/style.less
@@ -1,3 +1,9 @@
// Libraries that are not less
@import (inline) "css/jquery.autocomplete.css";
@import (inline) "css/shCore.css";
@import (inline) "css/jquery.qtip.min.css";
@import (inline) "css/shThemeDefault.css";

@import "bootstrap/bootstrap.less";
@import "font-awesome/font-awesome.less";

Expand Down Expand Up @@ -51,4 +57,4 @@
@font-size-base: 13px;

@fa-font-path: "/static/fonts/";
@icon-font-path: "/static/fonts/";
@icon-font-path: "/static/fonts/";

0 comments on commit 4f3520c

Please sign in to comment.