Skip to content

Commit 916e07d

Browse files
vuejs-jp-botre-fort
authored andcommitted
Improve typography for print media (vuejs#738)
* Update styles to enable printing docs (vuejs#1425) The sidebar, header, footer and Advertisement elements are now hidden when users print docs from the website. * Improve typography for print media (vuejs#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 (vuejs#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 b283514 commit 916e07d

File tree

3 files changed

+41
-1
lines changed

3 files changed

+41
-1
lines changed

themes/vue/source/css/_common.styl

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,3 +208,28 @@ sup.beta.beta
208208
margin-left: .7em
209209
text-transform: uppercase
210210
opacity: .6
211+
212+
@media print
213+
body
214+
color: rgb(0,0,0)
215+
.highlight
216+
padding: 0
217+
page-break-inside: avoid
218+
.code
219+
pre
220+
color: rgb(0,0,0)
221+
background-color: rgb(255,255,255)
222+
border-style: solid
223+
border-width: 2px 2px 2px 2px
224+
border-color: #e8e8e8
225+
page-break-inside: avoid
226+
h1,h2,h3,h4,h5
227+
color: rgb(0,0,0)
228+
page-break-after: avoid
229+
page-break-before:
230+
img
231+
page-break-inside: avoid
232+
h2+p
233+
page-break-before: avoid
234+
a:link:after, a:visited:after { content:" [" attr(href) "] "; }
235+

themes/vue/source/css/_demo.styl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,10 @@ ul#demo, ul.demo
6060

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

themes/vue/source/css/page.styl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,4 +250,12 @@
250250

251251
@media print
252252
.footer
253-
display: none
253+
display: none
254+
.content
255+
padding-left: 0px
256+
.content p
257+
line-height: 1.35em
258+
&.tip
259+
background-color: rgb(255,255,255)
260+
border: 2px solid #e8e8e8
261+
border-left: 4px solid $red

0 commit comments

Comments
 (0)