Adding media=print styles so that printed graphs look nicer.
authorAndrew Otto <acotto@gmail.com>
Wed, 18 Apr 2012 17:50:13 +0000 (13:50 -0400)
committerAndrew Otto <acotto@gmail.com>
Wed, 18 Apr 2012 17:50:13 +0000 (13:50 -0400)
www/css/graph-display-print.styl [new file with mode: 0644]
www/dashboard.jade
www/layout.jade

diff --git a/www/css/graph-display-print.styl b/www/css/graph-display-print.styl
new file mode 100644 (file)
index 0000000..8df9ddf
--- /dev/null
@@ -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
index 2cd7fc8..d60c150 100644 (file)
@@ -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)
index c6859c1..f524795 100644 (file)
@@ -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")