Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit 417f3c4

Browse files
feat(layout): add -print breakpoint alias
support layout and flex attributes * remove superfluous use of `screen and` in mediaQueries * also support `hide-print` to hide elements when printing * update docs to hide sideNav when printing * update docs to use white background colors for demos * support Layout API usages with print-xx suffices; which enabled component printing at the specified breakpoint range.
1 parent 9213687 commit 417f3c4

File tree

1 file changed

+105
-0
lines changed

1 file changed

+105
-0
lines changed
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
/*
2+
*
3+
* Adaptive Print settings with Breakpoint Aliases\
4+
*
5+
*/
6+
7+
// General printing Rules resets to default Layout API
8+
@media print {
9+
10+
// Override layout API settings to use defaults when printing.
11+
12+
@include layouts_for_breakpoint();
13+
@include layout-padding-margin();
14+
15+
// NOTE: the PRINT layouts will be the same as the default (no-aliase) layouts
16+
// @include layouts_for_breakpoint(print);
17+
18+
.hide-print:not(.show-print):not(.show) {
19+
display: none !important;
20+
}
21+
}
22+
23+
24+
@media print and (max-width: $layout-breakpoint-xs - 1) {
25+
// Xtra-SMALL SCREEN
26+
.hide-print-xs, .hide-print {
27+
&:not(.show-xs):not(.show) {
28+
display: none !important;
29+
}
30+
}
31+
@include layouts_for_breakpoint(xs);
32+
}
33+
34+
@media print and (min-width: $layout-breakpoint-xs) {
35+
// BIGGER THAN Xtra-SMALL SCREEN
36+
@include layouts_for_breakpoint(gt-xs);
37+
38+
}
39+
40+
@media print and (min-width: $layout-breakpoint-xs) and (max-width: $layout-breakpoint-sm - 1) {
41+
.hide-print, .hide-print-gt-xs {
42+
&:not(.show-gt-xs):not(.show-sm):not(.show) {
43+
display: none !important;
44+
}
45+
}
46+
.hide-print-sm:not(.show-print-gt-xs):not(.show-print-sm):not(.show-print) {
47+
display: none !important;
48+
}
49+
50+
@include layouts_for_breakpoint(sm);
51+
}
52+
53+
@media print and (min-width: $layout-breakpoint-sm) {
54+
// BIGGER THAN SMALL SCREEN
55+
@include layouts_for_breakpoint(gt-sm);
56+
57+
}
58+
59+
@media print and (min-width: $layout-breakpoint-sm) and (max-width: $layout-breakpoint-md - 1) {
60+
// MEDIUM SCREEN
61+
.hide-print, .hide-print-gt-xs, .hide-print-gt-sm {
62+
&:not(.show-print-gt-xs):not(.show-print-gt-sm):not(.show-print-md):not(.show-print) {
63+
display: none !important;
64+
}
65+
}
66+
.hide-print-md:not(.show-print-md):not(.show-print-gt-sm):not(.show-print-gt-xs):not(.show-print) {
67+
display: none !important;
68+
}
69+
@include layouts_for_breakpoint(md);
70+
}
71+
72+
@media print and (min-width: $layout-breakpoint-md) {
73+
// BIGGER THAN MEDIUM SCREEN
74+
@include layouts_for_breakpoint(gt-md);
75+
}
76+
77+
@media print and (min-width: $layout-breakpoint-md) and (max-width: $layout-breakpoint-lg - 1) {
78+
// LARGE SCREEN
79+
.hide-print,.hide-print-gt-xs, .hide-print-gt-sm, .hide-print-gt-md {
80+
&:not(.show-print-gt-xs):not(.show-print-gt-sm):not(.show-print-gt-md):not(.show-print-lg):not(.show-print) {
81+
display: none !important;
82+
}
83+
}
84+
.hide-print-lg:not(.show-print-lg):not(.show-print-gt-md):not(.show-print-gt-sm):not(.show-print-gt-xs):not(.show-print) {
85+
display: none !important;
86+
}
87+
88+
@include layouts_for_breakpoint(lg);
89+
}
90+
91+
@media print and (min-width: $layout-breakpoint-lg) {
92+
@include layouts_for_breakpoint(gt-lg);
93+
@include layouts_for_breakpoint(xl);
94+
95+
// BIGGER THAN LARGE SCREEN
96+
.hide-print, .hide-print-gt-xs, .hide-print-gt-sm, .hide-print-gt-md, .hide-print-gt-lg {
97+
&:not(.show-print-gt-xs):not(.show-print-gt-sm):not(.show-print-gt-md):not(.show-print-gt-lg):not(.show-print-xl):not(.show-print) {
98+
display: none !important;
99+
}
100+
}
101+
.hide-print-xl:not(.show-print-xl):not(.show-print-gt-lg):not(.show-print-gt-md):not(.show-print-gt-sm):not(.show-print-gt-xs):not(.show-print) {
102+
display: none !important;
103+
}
104+
105+
}

0 commit comments

Comments
 (0)