Add a print stylesheet removing the DevDocs UI

pull/684/merge
Jed Fox 7 years ago committed by Thibaut Courouble
parent c91bf6f369
commit b681c80ed0

@ -98,3 +98,7 @@
'pages/webpack', 'pages/webpack',
'pages/yard', 'pages/yard',
'pages/yii'; 'pages/yii';
html { // specificity hack
@import 'global/print';
}

@ -2,6 +2,19 @@
// Utilities // Utilities
// //
/* Usage:
*
* @include print {
* // print styles here
* }
*
*/
@mixin print {
@media print {
@content;
}
}
%border-box { %border-box {
-moz-box-sizing: border-box; -moz-box-sizing: border-box;
box-sizing: border-box; box-sizing: border-box;

@ -0,0 +1,85 @@
// Style overrides for printing
@include print {
._header, ._sidebar, ._path, ._notif, ._toc, ._pre-clip, ._notice {
display: none !important;
}
// make the docs fill the page and scroll the <body> instead of ._container
body {
height: initial;
&::after {
content: '';
clear: both;
}
}
._app {
height: initial;
}
._container {
margin: 0;
padding: 0;
height: initial;
._content {
margin: 0;
}
}
// Hide the scrollbars
::-webkit-scrollbar {
display: none;
}
// empty the boxes.
%box,
%heading-box {
background: transparent;
}
%heading-box {
border-radius: 0;
border: {
top: none;
left: none;
right: none;
}
}
// Underline links, put the destination after the link text
%external-link {
text-decoration: underline;
&::after {
content: ' (' attr(href) ')';
background-image: none;
display: inline;
margin: 0;
}
}
// Link back to DevDocs
._attribution-p {
background: transparent;
border: 2px solid $labelBackground;
&:after {
content: 'Exported from DevDocs (https://devdocs.io)';
font-style: italic;
}
}
// Fix page breaks
pre {
page-break-before: avoid;
}
pre {
orphans: 5;
widows: 5;
}
p {
orphans: 2;
widows: 2;
}
}

@ -27,6 +27,10 @@
@extend %user-select-none; @extend %user-select-none;
&:hover { text-decoration: underline; } &:hover { text-decoration: underline; }
@include print {
display: none;
}
} }
.method-description { position: relative; } .method-description { position: relative; }

Loading…
Cancel
Save