History

Tweak print stylesheet

Thibaut Courouble committed 8 years ago

Commit 0bd82891 parent b681c806 files · +37 −68Browse files

Unified · Split

6 files
  1. assets/stylesheets/application-dark.css.scss +1 −0
  2. assets/stylesheets/application.css.scss +1 −4
  3. assets/stylesheets/global/_base.scss +3 −0
  4. assets/stylesheets/global/_classes.scss +0 −13
  5. assets/stylesheets/global/_mixins.scss +9 −0
  6. assets/stylesheets/global/_print.scss +23 −51
assets/stylesheets/application-dark.css.scss+1−0
@@ -12,6 +12,7 @@ · 11 unmodified lines
1212 */
1313
1414 @import 'global/variables-dark',
15+ 'global/mixins',
1516 'global/icons',
1617 'global/classes',
1718 'global/base';
assets/stylesheets/application.css.scss+1−4
@@ -12,6 +12,7 @@ · 11 unmodified lines
1212 */
1313
1414 @import 'global/variables',
15+ 'global/mixins',
1516 'global/icons',
1617 'global/classes',
1718 'global/base';
@@ -98,7 +99,3 @@ · 80 unmodified lines
9899 'pages/webpack',
99100 'pages/yard',
100101 'pages/yii';
101−
102−html { // specificity hack
103− @import 'global/print';
104−}
assets/stylesheets/global/_base.scss+3−0
@@ -4,6 +4,9 @@ html { · 3 unmodified lines
44 background: $documentBackground;
55
66 @media #{$mediumScreen} { font-size: 93.75%; }
7+
8+ @include print { background: none; }
9+ @import 'global/print';
710 }
811
912 body {
assets/stylesheets/global/_classes.scss+0−13
@@ -2,19 +2,6 @@ · 1 unmodified line
22 // Utilities
33 //
44
5−/* Usage:
6− *
7− * @include print {
8− * // print styles here
9− * }
10− *
11− */
12−@mixin print {
13− @media print {
14− @content;
15− }
16−}
17−
185 %border-box {
196 -moz-box-sizing: border-box;
207 box-sizing: border-box;
assets/stylesheets/global/_mixins.scss+9−0
@@ -0,0 +1,9 @@
1+//
2+// Mixins
3+//
4+
5+@mixin print {
6+ @media print {
7+ @content;
8+ }
9+}
assets/stylesheets/global/_print.scss+23−51
@@ -1,79 +1,51 @@
1−// Style overrides for printing
2−
31 @include print {
4−
5− ._header, ._sidebar, ._path, ._notif, ._toc, ._pre-clip, ._notice {
2+ ._header, ._sidebar, ._path, ._notif, ._toc, ._pre-clip, ._notice, ._links {
63 display: none !important;
74 }
85
9− // make the docs fill the page and scroll the <body> instead of ._container
10− body {
11− height: initial;
12− &::after {
13− content: '';
14− clear: both;
15− }
16− }
17− ._app {
18− height: initial;
19− }
20− ._container {
6+ body, ._app, ._container, ._content {
217 margin: 0;
228 padding: 0;
239 height: initial;
10+ background: none;
2411
25− ._content {
26− margin: 0;
12+ &:after {
13+ content: '';
14+ clear: both;
2715 }
2816 }
2917
30− // Hide the scrollbars
3118 ::-webkit-scrollbar {
3219 display: none;
3320 }
3421
35− // empty the boxes.
36− %box,
37− %heading-box {
38− background: transparent;
39− }
40− %heading-box {
41− border-radius: 0;
42− border: {
43− top: none;
44− left: none;
45− right: none;
46− }
22+ %external-link:after {
23+ display: none;
4724 }
4825
26+ ._attribution-p {
27+ background: none;
28+ border: 2px solid $boxBorder;
29+ }
4930
50− // Underline links, put the destination after the link text
51− %external-link {
52− text-decoration: underline;
53− &::after {
54− content: ' (' attr(href) ')';
55− background-image: none;
56− display: inline;
57− margin: 0;
58− }
31+ ._attribution:last-child:after {
32+ content: 'Exported from DevDocs — https://devdocs.io';
33+ display: block;
34+ margin-top: 1rem;
35+ font-weight: $bolderFontWeight;
5936 }
6037
61− // Link back to DevDocs
62− ._attribution-p {
63− background: transparent;
64− border: 2px solid $labelBackground;
38+ ._attribution {
39+ page-break-inside: avoid;
40+ }
6541
66− &:after {
67− content: 'Exported from DevDocs (https://devdocs.io)';
68− font-style: italic;
69− }
42+ h1, h2, h3, h4, h5, h6 {
43+ page-break-inside: avoid;
44+ page-break-after: avoid;
7045 }
7146
72− // Fix page breaks
7347 pre {
7448 page-break-before: avoid;
75− }
76− pre {
7749 orphans: 5;
7850 widows: 5;
7951 }