Skip to content

Commit

Permalink
Improve typography for print media (vuejs#738)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
vuejs-jp-bot authored and re-fort committed Feb 28, 2018
1 parent b283514 commit 916e07d
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
25 changes: 25 additions & 0 deletions themes/vue/source/css/_common.styl
Original file line number Diff line number Diff line change
Expand Up @@ -208,3 +208,28 @@ sup.beta.beta
margin-left: .7em
text-transform: uppercase
opacity: .6

@media print
body
color: rgb(0,0,0)
.highlight
padding: 0
page-break-inside: avoid
.code
pre
color: rgb(0,0,0)
background-color: rgb(255,255,255)
border-style: solid
border-width: 2px 2px 2px 2px
border-color: #e8e8e8
page-break-inside: avoid
h1,h2,h3,h4,h5
color: rgb(0,0,0)
page-break-after: avoid
page-break-before:
img
page-break-inside: avoid
h2+p
page-break-before: avoid
a:link:after, a:visited:after { content:" [" attr(href) "] "; }

7 changes: 7 additions & 0 deletions themes/vue/source/css/_demo.styl
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,10 @@ ul#demo, ul.demo

th, td
padding: 3px 7px

@media print
#demo, .demo, .content .demo
page-break-inside: avoid
padding: 1em
margin-bottom: 1em
border-width: 2px
10 changes: 9 additions & 1 deletion themes/vue/source/css/page.styl
Original file line number Diff line number Diff line change
Expand Up @@ -250,4 +250,12 @@

@media print
.footer
display: none
display: none
.content
padding-left: 0px
.content p
line-height: 1.35em
&.tip
background-color: rgb(255,255,255)
border: 2px solid #e8e8e8
border-left: 4px solid $red

0 comments on commit 916e07d

Please sign in to comment.