groovydev / twitter-bootstrap-grails-plugin

Grails plugin for Twitter Bootstrap CSS framework resources
173 stars 92 forks source link

Bootstrap styling for printed pages #99

Open ch0wnag3 opened 10 years ago

ch0wnag3 commented 10 years ago

I noticed that printed pages within my app were rather ugly and I stumbled across this:

http://stackoverflow.com/questions/12302819/how-to-create-a-printable-twitter-bootstrap-page

Using the answer there as a guide, I added tweaked my layout like so:

<r:require modules="bootstrap"/>
<!-- This is what I added -->
<link href="/myApp/static/bundle-bundle_bootstrap_head.css" type="text/css" rel="stylesheet" media="print" />

This feels like a very hacky solution. I've read over the documentation and couldn't find anything that addresses the problem.

buzzsawddog commented 10 years ago

I can confirm that the problem is there.

<link href="/SomeProject/static/bundle-bundle_bootstrap_head.css" type="text/css" rel="stylesheet" media="screen, projection">

is what is generated and... it does not include the print version.

ocomsoft commented 10 years ago

The following needs to change in conf/BootstrapResources.groovy:42

resource id: 'bootstrap-css', url:[plugin: 'twitter-bootstrap', dir: 'css', file: (dev ? cssFile : cssminFile)], disposition: 'head', exclude:'minify' , attrs:[media:'screen, projection, print']

Added in , attrs:[media:'screen, projection, print']

This will break bundling.