Skip to content

Docs - Improve typographic styles for print media #1439

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
NiloCK opened this issue Feb 18, 2018 · 3 comments
Closed

Docs - Improve typographic styles for print media #1439

NiloCK opened this issue Feb 18, 2018 · 3 comments

Comments

@NiloCK
Copy link
Contributor

NiloCK commented Feb 18, 2018

A number of stylistic choices for the documentation work much better for web than for print.

  • Dark grey (and not black) text on a white background
  • 1.6em line height
  • code snippet boxes with greyed backgrounds

These could be improved in a @media print query.

NiloCK added a commit to NiloCK/vuejs.org that referenced this issue Feb 18, 2018
- _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
NiloCK added a commit to NiloCK/vuejs.org that referenced this issue Feb 18, 2018
- _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
@NiloCK
Copy link
Contributor Author

NiloCK commented Feb 18, 2018

One problem persists after the commits above - page breaks are occurring directly after h1, h2, hn blocks. The css properties page-break-after and page-break-before aren't very reliable.

One solution is described here, and involves wrapping the headers and the next element with a div that's given the more reliable page-break-inside: avoid property. Doing this via JS on page load is easy enough, but some might consider that a bit too hacky and intrusive.

If no-one objects to the notion (or suggests a better alternative) in the next few days, I'll have a look at implementing.

@sdras
Copy link
Member

sdras commented Feb 18, 2018

Hm, that does sound a bit hacky indeed, especially for not-so-common use case. What about trying with page-break-after and page-break-before and testing first- maybe it will prove to be more effective than we think. Worth trying first, anyways. :)

I added a comment about links as well. Sounds like the right track for everything else.

chrisvfritz pushed a commit that referenced this issue Feb 27, 2018
* 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
@chrisvfritz
Copy link
Contributor

This has been merged! Happy to keep accepting new contributions, but considering this resolved for now. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants