Skip to content

Commit 44c8fcb

Browse files
NiloCKchrisvfritz
authored andcommitted
Improve typography for print media (#1439) (#1440)
* Update styles to enable printing docs (#1425) The sidebar, header, footer and Advertisement elements are now hidden when users print docs from the website. * Improve typography for print media (#1439) - _common.styl - Grey(ish) text replaced with black - page-breaks now avoided in code snippets - shaded BG colors replaced with border-boxes - _demo.styl - Demonstration box padding, margins tightened up - page-breaks avoided - _page.styl - remove padding from left of page - reduce line-height - dense reading is more comfortable from the page - shaded BG colors in 'tip' boxes replaced with border-box * Improve typography for print media (#1439) - _common.styl - Grey(ish) text replaced with black - page-breaks now avoided in code snippets - shaded BG colors replaced with border-boxes - _demo.styl - Demonstration box padding, margins tightened up - page-breaks avoided - _page.styl - remove padding from left of page - reduce line-height - dense reading is more comfortable from the page - shaded BG colors in 'tip' boxes replaced with border-box * Add links to printed typography
1 parent 7bedc42 commit 44c8fcb

File tree

3 files changed

+41
-1
lines changed

3 files changed

+41
-1
lines changed

themes/vue/source/css/_common.styl

+25
Original file line numberDiff line numberDiff line change
@@ -192,3 +192,28 @@ sup.beta.beta
192192
margin-left: .7em
193193
text-transform: uppercase
194194
opacity: .6
195+
196+
@media print
197+
body
198+
color: rgb(0,0,0)
199+
.highlight
200+
padding: 0
201+
page-break-inside: avoid
202+
.code
203+
pre
204+
color: rgb(0,0,0)
205+
background-color: rgb(255,255,255)
206+
border-style: solid
207+
border-width: 2px 2px 2px 2px
208+
border-color: #e8e8e8
209+
page-break-inside: avoid
210+
h1,h2,h3,h4,h5
211+
color: rgb(0,0,0)
212+
page-break-after: avoid
213+
page-break-before:
214+
img
215+
page-break-inside: avoid
216+
h2+p
217+
page-break-before: avoid
218+
a:link:after, a:visited:after { content:" [" attr(href) "] "; }
219+

themes/vue/source/css/_demo.styl

+7
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,10 @@ ul#demo, ul.demo
6161

6262
th, td
6363
padding: 3px 7px
64+
65+
@media print
66+
#demo, .demo, .content .demo
67+
page-break-inside: avoid
68+
padding: 1em
69+
margin-bottom: 1em
70+
border-width: 2px

themes/vue/source/css/page.styl

+9-1
Original file line numberDiff line numberDiff line change
@@ -243,4 +243,12 @@
243243

244244
@media print
245245
.footer
246-
display: none
246+
display: none
247+
.content
248+
padding-left: 0px
249+
.content p
250+
line-height: 1.35em
251+
&.tip
252+
background-color: rgb(255,255,255)
253+
border: 2px solid #e8e8e8
254+
border-left: 4px solid $red

0 commit comments

Comments
 (0)