asciidoctor-latex
asciidoctor-latex copied to clipboard
Better way of adding alternate style sheets
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?
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/
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.
:+1: