asciidoctor / asciidoctor-latex

:triangular_ruler: Add LaTeX features to AsciiDoc & convert AsciiDoc to LaTeX
http://asciidoctor.org
Other
112 stars 26 forks source link

Better way of adding alternate style sheets #41

Open jxxcarlson opened 9 years ago

jxxcarlson commented 9 years ago

Currently the style sheet data/extras.css is added by default using the code in css.rb via class CSSDocinfoProcessor as suggested by @mojavelinux . I need to append the text in the tail of data/extras_print_version.css. At the moment I do something stupid: if doc.attributes['print_format'] == yes, the stylesheet extras_print_version.css is loaded, otherwise extras.css is. A quick, dirty, BAD solution. Suggestions? Is there a way of modifying extras.css on the fly?

mojavelinux commented 8 years ago

Why not just always add the print styles and wrap them in

@media print {
}

CSS already provides this conditional block specifically for print.

See:

jxxcarlson commented 8 years ago

I have been using this for a while now on noteshare.io http://noteshare.io/. It is a great solution because the user doesn’t have to do anything.

On Dec 4, 2015, at 2:07 AM, Dan Allen notifications@github.com wrote:

Why not just always add the print styles and wrap them in

@media print { } CSS already provides this conditional block specifically for print.

See:

https://developer.mozilla.org/en-US/docs/Web/CSS/@media https://developer.mozilla.org/en-US/docs/Web/CSS/@media http://www.smashingmagazine.com/2011/11/how-to-set-up-a-print-style-sheet/ http://www.smashingmagazine.com/2011/11/how-to-set-up-a-print-style-sheet/ — Reply to this email directly or view it on GitHub https://github.com/asciidoctor/asciidoctor-latex/issues/41#issuecomment-161895269.

mojavelinux commented 8 years ago

:+1: