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

Commit eb1249d

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 0dc2ec7 commit eb1249d

File tree

21 files changed

+610
-457
lines changed

21 files changed

+610
-457
lines changed

docs/app/css/layout-demo.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
demo-include {
22
display: block;
3+
background-color:white;
34
}
45

56
.colorNested .demo-content > div div {

docs/config/template/index.template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<body layout="row" ng-cloak>
1616

1717
<md-sidenav class="site-sidenav md-sidenav-left md-whiteframe-z2"
18-
md-component-id="left"
18+
md-component-id="left" hide-print
1919
md-is-locked-open="$mdMedia('gt-sm')">
2020

2121
<header class="nav-header">

gulp/config.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,13 @@ module.exports = {
2929
'src/core/style/mixins.scss',
3030
'src/core/style/structure.scss',
3131
'src/core/style/typography.scss',
32+
'src/core/style/layout.scss',
3233
'src/core/services/layout/layout.scss'
3334
],
34-
scssStandaloneFiles: [
35-
'src/core/services/layout/layout.attributes.scss'
36-
],
37-
scssTestFiles: [
38-
'src/core/services/layout/layout.scss'
39-
],
35+
scssPrintFiles: [
36+
'src/core/style/layout.scss',
37+
'src/core/services/layout/layout.print.scss'
38+
],
4039
paths: 'src/{components,services}/**',
4140
outputDir: 'dist/',
4241
demoFolder: 'demo-partials'

gulp/tasks/build-scss.js

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,31 +30,28 @@ exports.task = function() {
3030
gulp.src(paths)
3131
.pipe(util.filterNonCodeFiles())
3232
.pipe(filter(['**', '!**/*-theme.scss']))
33+
.pipe(filter(['**', '!**/*.attributes.scss'])) // no layout attribute selectors
34+
.pipe(filter(['**', '!**/*.print.scss'])) // no print styles
3335
.pipe(concat('angular-material.scss'))
34-
.pipe(gulp.dest(dest))
36+
.pipe(gulp.dest(dest)) // raw uncompiled SCSSS
3537
);
3638

3739
streams.push(
38-
gulp.src(paths)
39-
.pipe(util.filterNonCodeFiles())
40-
.pipe(filter(['**', '!**/*-theme.scss']))
41-
.pipe(filter(['**', '!**/attributes.scss']))
42-
.pipe(concat('angular-material.scss'))
40+
gulp.src(dest)
4341
.pipe(sass())
4442
.pipe(rename({ basename: filename }))
4543
.pipe(util.autoprefix())
4644
.pipe(insert.prepend(config.banner))
47-
.pipe(gulp.dest(dest))
45+
.pipe(gulp.dest(dest)) // unminified
4846
.pipe(gulpif(!IS_DEV, minifyCss()))
4947
.pipe(rename({extname: '.min.css'}))
50-
.pipe(gulp.dest(dest))
48+
.pipe(gulp.dest(dest)) // minified
5149
);
5250
streams.push(
53-
gulp.src(config.scssStandaloneFiles)
54-
.pipe(insert.prepend(baseVars))
51+
gulp.src(config.scssPrintFiles.slice()) // Layout API for Printing
5552
.pipe(sass())
5653
.pipe(util.autoprefix())
57-
.pipe(rename({ basename: "layouts" }))
54+
.pipe(rename({ basename: "print" }))
5855
.pipe(rename({ prefix: 'angular-material.'}))
5956
.pipe(insert.prepend(config.banner))
6057
.pipe(gulp.dest(dest))

src/components/bottomSheet/bottom-sheet.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,19 +121,19 @@ md-bottom-sheet {
121121
}
122122
}
123123

124-
@media screen and (max-width: $layout-breakpoint-sm) {
124+
@media (max-width: $layout-breakpoint-sm) {
125125
@include grid-items-per-row(3, true);
126126
}
127127

128-
@media screen and (min-width: $layout-breakpoint-sm) and (max-width: $layout-breakpoint-md - 1) {
128+
@media (min-width: $layout-breakpoint-sm) and (max-width: $layout-breakpoint-md - 1) {
129129
@include grid-items-per-row(4);
130130
}
131131

132-
@media screen and (min-width: $layout-breakpoint-md) and (max-width: $layout-breakpoint-lg - 1) {
132+
@media (min-width: $layout-breakpoint-md) and (max-width: $layout-breakpoint-lg - 1) {
133133
@include grid-items-per-row(6);
134134
}
135135

136-
@media screen and (min-width: $layout-breakpoint-lg) {
136+
@media (min-width: $layout-breakpoint-lg) {
137137
@include grid-items-per-row(7);
138138
}
139139

src/components/chips/demoContactChips/style.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ md-content.autocomplete {
3434
}
3535
}
3636

37-
@media screen and (min-width: 960px) {
37+
@media (min-width: 960px) {
3838
float: left;
3939
width: 33%;
4040
}

src/components/content/content.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ md-content {
2222
&.autoScroll {
2323
-webkit-overflow-scrolling: auto;
2424
}
25+
26+
@media print {
27+
overflow: visible !important;
28+
}
2529
}
2630

2731

src/components/fabSpeedDial/demoMoreOptions/style.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
top: 16px;
44
}
55

6-
@media only screen and (max-device-width: 600px) {
6+
@media (max-device-width: 600px) {
77
.md-fab-top-right {
88
top: 9px;
99
right: 9px;

src/components/sidenav/sidenav.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,13 @@ md-sidenav {
9292
}
9393
}
9494

95-
@media screen and (min-width: $layout-breakpoint-xs) {
95+
@media (min-width: $layout-breakpoint-xs) {
9696
md-sidenav {
9797
max-width: $sidenav-desktop-width;
9898
}
9999
}
100100

101-
@media screen and (max-width: $sidenav-desktop-width + $sidenav-min-space) {
101+
@media (max-width: $sidenav-desktop-width + $sidenav-min-space) {
102102
md-sidenav {
103103
width: calc(100% - #{$sidenav-min-space});
104104
min-width: calc(100% - #{$sidenav-min-space});

src/components/toolbar/toolbar.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ md-toolbar {
132132
}
133133

134134
// Handle mobile portrait
135-
@media only screen and (min-width: 0) and (max-width: $layout-breakpoint-sm - 1) and (orientation: portrait) {
135+
@media (min-width: 0) and (max-width: $layout-breakpoint-sm - 1) and (orientation: portrait) {
136136
md-toolbar {
137137
min-height: $toolbar-height-mobile-portrait;
138138
}
@@ -144,7 +144,7 @@ md-toolbar {
144144
}
145145

146146
// Handle mobile landscape
147-
@media only screen and (min-width: 0) and (max-width: $layout-breakpoint-sm - 1) and (orientation: landscape) {
147+
@media (min-width: 0) and (max-width: $layout-breakpoint-sm - 1) and (orientation: landscape) {
148148
md-toolbar {
149149
min-height: $toolbar-height-mobile-landscape;
150150
}

0 commit comments

Comments
 (0)