Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
fix(subheader): fix width styling while scrolling
closes #1339
  • Loading branch information
rschmukler committed Apr 6, 2015
1 parent e18450f commit 2f33573
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
6 changes: 2 additions & 4 deletions src/components/sticky/sticky.scss
Expand Up @@ -9,10 +9,8 @@

&[sticky-state="active"] {
transform: translate3d(0, 0, 0);
&:not(.md-sticky-no-effect) {
&:after {
animation: subheaderStickyHoverIn 0.3s ease-out both;
}
&:not(.md-sticky-no-effect) .md-subheader-inner {
animation: subheaderStickyHoverIn 0.3s ease-out both;
}
}
}
4 changes: 3 additions & 1 deletion src/components/subheader/subheader.js
Expand Up @@ -50,7 +50,9 @@ function MdSubheaderDirective($mdSticky, $compile, $mdTheming) {
transclude: true,
template:
'<h2 class="md-subheader">' +
'<span class="md-subheader-content"></span>' +
'<div class="md-subheader-inner">' +
'<span class="md-subheader-content"></span>' +
'</div>' +
'</h2>',
compile: function(element, attr, transclude) {
var outerHTML = element[0].outerHTML;
Expand Down
7 changes: 5 additions & 2 deletions src/components/subheader/subheader.scss
Expand Up @@ -28,11 +28,14 @@ $subheader-sticky-shadow: 0px 2px 4px 0 rgba(0,0,0,0.16) !default;
font-size: $subheader-font-size;
font-weight: $subheader-font-weight;
line-height: $subheader-line-height;
padding: $subheader-padding;
margin: $subheader-margin;
margin-right: $subheader-margin-right;
position: relative;

.md-subheader-inner {
padding: $subheader-padding;
}

&:not(.md-sticky-no-effect) {
&:after {
position: absolute;
Expand All @@ -50,7 +53,7 @@ $subheader-sticky-shadow: 0px 2px 4px 0 rgba(0,0,0,0.16) !default;
&[sticky-state="active"] {
margin-top: -2px;
}
&:not(.md-sticky-clone)[sticky-prev-state="active"]:after {
&:not(.md-sticky-clone)[sticky-prev-state="active"] .md-subheader-inner:after {
animation: subheaderStickyHoverOut 0.3s ease-out both;
}
}
Expand Down

0 comments on commit 2f33573

Please sign in to comment.