From fe22d6d0950258e131332aae0d3891cc769d8fda Mon Sep 17 00:00:00 2001 From: Andrew Otto Date: Wed, 18 Apr 2012 13:50:13 -0400 Subject: [PATCH] Adding media=print styles so that printed graphs look nicer. --- www/css/graph-display-print.styl | 17 +++++++++++++++++ www/dashboard.jade | 6 ++++++ www/layout.jade | 3 +++ 3 files changed, 26 insertions(+), 0 deletions(-) create mode 100644 www/css/graph-display-print.styl diff --git a/www/css/graph-display-print.styl b/www/css/graph-display-print.styl new file mode 100644 index 0000000..8df9ddf --- /dev/null +++ b/www/css/graph-display-print.styl @@ -0,0 +1,17 @@ +// Overrides for styles in +// graph-display.styl. +section.graph-display.graph + // force printer page break after each graph + page-break-after always + + // push the legend below + // the graph, so that the whole + // graph is visible. + .graph-legend + position relative + + // give the permalink some space. + .graph-permalink + padding 1em + + \ No newline at end of file diff --git a/www/dashboard.jade b/www/dashboard.jade index 2cd7fc8..d60c150 100644 --- a/www/dashboard.jade +++ b/www/dashboard.jade @@ -5,7 +5,13 @@ block title append styles mixin css('graph-display.css') + mixin css('graph-display.css', media='print') + //- graph-display-print contains overrides + //- needed to make printed pages look better + mixin css('graph-display-print.css', media='print') mixin css('dashboard.css') + mixin css('dashboard.css', media='print') + block main-scripts script(src="/js/kraken/main-dashboard.js?"+version) diff --git a/www/layout.jade b/www/layout.jade index c6859c1..f524795 100644 --- a/www/layout.jade +++ b/www/layout.jade @@ -11,7 +11,10 @@ html block styles //- mixin css('reset.min.css') mixin css('/vendor/bootstrap/css/bootstrap.css') + mixin css('/vendor/bootstrap/css/bootstrap.css', media='print') mixin css('layout.css') + mixin css('layout.css', media='print') + link(type="image/ico", rel="icon", href="/favicon.ico") link(type="image/x-icon", rel="shortcut icon", href="/favicon.ico") -- 1.7.0.4