Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding options for hiding drawer buttons (always and desktop only). Fixes #1462. #1467

Merged
merged 1 commit into from
Aug 27, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/layout/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,8 @@ The MDL CSS classes apply various predefined visual and behavioral enhancements
| `mdl-layout__header--scroll` | Makes the header scroll with the content | Optional; goes on header element |
| `mdl-layout--fixed-drawer` | Makes the drawer always visible and open in larger screens | Optional; goes on outer div element (not drawer div element) |
| `mdl-layout--fixed-header` | Makes the header always visible, even in small screens | Optional; goes on outer div element |
| `mdl-layout--no-drawer-button` | Does not display a drawer button | Optional; goes on `mdl-layout` element |
| `mdl-layout--no-desktop-drawer-button` | Does not display a drawer button in desktop mode | Optional; goes on `mdl-layout` element |
| `mdl-layout--large-screen-only` | Hides an element on smaller screens | Optional; goes on any descendant of `mdl-layout` |
| `mdl-layout--small-screen-only` | Hides an element on larger screens | Optional; goes on any descendant of `mdl-layout` |
| `mdl-layout__header--waterfall` | Allows a "waterfall" effect with multiple header lines | Optional; goes on header element |
Expand Down
55 changes: 54 additions & 1 deletion src/layout/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,14 @@
.mdl-layout--fixed-drawer > & {
display: none;
}

.mdl-layout--no-desktop-drawer-button & {
display: none;
}
}

.mdl-layout--no-drawer-button & {
display: none;
}
}

Expand Down Expand Up @@ -337,9 +345,23 @@
margin: 0;
padding: 0 $layout-header-desktop-indent 0 $layout-header-desktop-baseline;

.mdl-layout--no-drawer-button & {
padding-left: $layout-header-desktop-indent;
}

@media screen and (min-width: $layout-screen-size-threshold + 1px) {
.mdl-layout--no-desktop-drawer-button & {
padding-left: $layout-header-desktop-indent;
}
}

@media screen and (max-width: $layout-screen-size-threshold) {
height: $layout-header-mobile-row-height;
padding: 0 $layout-header-mobile-indent 0 $layout-header-mobile-baseline;

.mdl-layout--no-drawer-button & {
padding-left: $layout-header-mobile-indent;
}
}

& > * {
Expand Down Expand Up @@ -372,7 +394,8 @@
line-height: $layout-header-mobile-row-height;
padding: 0 $layout-header-mobile-indent;
}
} }
}
}

// Obfuscator.
.mdl-layout__obfuscator {
Expand Down Expand Up @@ -443,11 +466,31 @@
display: none;
}

.mdl-layout--no-drawer-button & {
padding-left: $layout-header-desktop-indent - $layout-tab-desktop-padding;
width: calc(100% -
#{(($layout-header-desktop-indent - $layout-tab-desktop-padding) * 2)});
}

@media screen and (min-width: $layout-screen-size-threshold + 1px) {
.mdl-layout--no-desktop-drawer-button & {
padding-left: $layout-header-desktop-indent - $layout-tab-desktop-padding;
width: calc(100% -
#{(($layout-header-desktop-indent - $layout-tab-desktop-padding) * 2)});
}
}

@media screen and (max-width: $layout-screen-size-threshold) {
width: calc(100% -
#{($layout-header-mobile-baseline - $layout-tab-mobile-padding)});
padding: 0 0 0
($layout-header-mobile-baseline - $layout-tab-mobile-padding);

.mdl-layout--no-drawer-button & {
width: calc(100% -
#{(($layout-header-mobile-indent - $layout-tab-mobile-padding) * 2)});
padding-left: $layout-header-mobile-indent - $layout-tab-mobile-padding;
}
}

.mdl-layout--fixed-tabs & {
Expand Down Expand Up @@ -488,6 +531,16 @@
cursor: pointer;
user-select: none;

.mdl-layout--no-desktop-drawer-button &,
.mdl-layout--no-drawer-button & {
width: $layout-header-desktop-indent - $layout-tab-desktop-padding;

& .material-icons {
position: relative;
left: ($layout-header-desktop-indent - $layout-tab-desktop-padding - 24px) / 2;
}
}

@media screen and (max-width: $layout-screen-size-threshold) {
display: none;
width: $layout-header-mobile-baseline - $layout-tab-mobile-padding;
Expand Down