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,10 +46,14 @@ body {
position: relative; position: relative;
min-height: 100%; min-height: 100%;
// Lock body to viewport height (e.g. in search mode) // [tablet portrait -]: Lock body to disable scroll bubbling
&[data-md-locked] { @include break-to-device(tablet portrait) {
height: 100%;
overflow: hidden; // Lock body to viewport height (e.g. in search mode)
&[data-md-locked] {
height: 100%;
overflow: hidden;
}
} }
} }
@ -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;