From 2e728cc9f6849ec328dffda47ce12a1bef0e3fbf Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Sun, 15 Oct 2017 21:54:59 -0400 Subject: [PATCH] Improve printing of code blocks - Hide clipboard icon - Wrap code and hide the scrollbar --- src/assets/stylesheets/base/_typeset.scss | 5 +++++ src/assets/stylesheets/layout/_clipboard.scss | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/assets/stylesheets/base/_typeset.scss b/src/assets/stylesheets/base/_typeset.scss index 7c4f6b415..dc4c6dde9 100644 --- a/src/assets/stylesheets/base/_typeset.scss +++ b/src/assets/stylesheets/base/_typeset.scss @@ -166,6 +166,11 @@ kbd { background-color: $md-code-background; color: $md-code-color; font-size: 85%; + + // Wrap text and hide scollbars + @media print { + white-space: pre-wrap; + } } // Inline code blocks, correct relative ems for smaller font size diff --git a/src/assets/stylesheets/layout/_clipboard.scss b/src/assets/stylesheets/layout/_clipboard.scss index bc21a952d..73b29d8bb 100644 --- a/src/assets/stylesheets/layout/_clipboard.scss +++ b/src/assets/stylesheets/layout/_clipboard.scss @@ -38,6 +38,11 @@ // Hack: put everything on the GPU to omit flickering backface-visibility: hidden; + // Hide for print + @media print { + display: none; + } + // Icon &::before { @extend %md-icon;