1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2024-12-18 02:15:56 +01:00

Added basic styles for @media print

This commit is contained in:
squidfunk 2016-10-24 18:02:53 +02:00
parent 26b1de049b
commit d3ed8ccec6
7 changed files with 39 additions and 5 deletions

View File

@ -1,3 +1,4 @@
/build /build
/material /material
/site /site
/lib

View File

@ -102,7 +102,7 @@ rules:
- order: smacss - order: smacss
property-units: property-units:
- 2 - 2
- global: [rem, em, s, vh] - global: [rem, em, s, vh, mm]
pseudo-element: 2 pseudo-element: 2
quotes: quotes:
- 2 - 2

View File

@ -37,6 +37,11 @@
opacity 0.125s 0.25s; opacity 0.125s 0.25s;
color: $md-color-black--lighter; color: $md-color-black--lighter;
opacity: 0; opacity: 0;
// Hide for print
@media print {
display: none;
}
} }
// All headers with permalinks have ids // All headers with permalinks have ids

View File

@ -46,11 +46,15 @@ body {
position: relative; position: relative;
min-height: 100%; min-height: 100%;
// [tablet portrait -]: Lock body to disable scroll bubbling
@include break-to-device(tablet portrait) {
// Lock body to viewport height (e.g. in search mode) // Lock body to viewport height (e.g. in search mode)
&[data-md-locked] { &[data-md-locked] {
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
} }
}
} }
// Horizontal separators // Horizontal separators
@ -160,3 +164,12 @@ hr {
overflow: hidden; overflow: hidden;
} }
} }
// ----------------------------------------------------------------------------
// Rules: print styles
// ----------------------------------------------------------------------------
// Add margins to page
@page {
margin: 25mm;
}

View File

@ -30,6 +30,11 @@
bottom: 0; bottom: 0;
width: 100%; width: 100%;
// Hide for print
@media print {
display: none;
}
// Footer container // Footer container
&__inner { &__inner {
background: $md-color-black; background: $md-color-black;

View File

@ -36,6 +36,11 @@
background: $md-color-primary; background: $md-color-primary;
color: $md-color-white; color: $md-color-white;
z-index: 1; z-index: 1;
// Hide for print
@media print {
display: none;
}
} }
// Navigation within header // Navigation within header

View File

@ -31,6 +31,11 @@
float: left; float: left;
overflow: visible; overflow: visible;
// Hide for print
@media print {
display: none;
}
// Lock sidebar to container height (account for fixed header) // Lock sidebar to container height (account for fixed header)
&[data-md-locked] { &[data-md-locked] {
position: fixed; position: fixed;