asciidoctor-latex icon indicating copy to clipboard operation
asciidoctor-latex copied to clipboard

Better way of adding alternate style sheets

Open jxxcarlson opened this issue 9 years ago • 3 comments

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?

jxxcarlson avatar Aug 24 '15 22:08 jxxcarlson

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
  • http://www.smashingmagazine.com/2011/11/how-to-set-up-a-print-style-sheet/

mojavelinux avatar Dec 04 '15 07:12 mojavelinux

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 [email protected] 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.

jxxcarlson avatar Dec 04 '15 13:12 jxxcarlson

:+1:

mojavelinux avatar Dec 04 '15 21:12 mojavelinux