diff --git a/src/components/sticky/sticky.scss b/src/components/sticky/sticky.scss index b11b4118cfd..d116a93f205 100644 --- a/src/components/sticky/sticky.scss +++ b/src/components/sticky/sticky.scss @@ -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; } } } diff --git a/src/components/subheader/subheader.js b/src/components/subheader/subheader.js index 233f06beb0f..a7c899efceb 100644 --- a/src/components/subheader/subheader.js +++ b/src/components/subheader/subheader.js @@ -50,7 +50,9 @@ function MdSubheaderDirective($mdSticky, $compile, $mdTheming) { transclude: true, template: '

' + - '' + + '
' + + '' + + '
' + '

', compile: function(element, attr, transclude) { var outerHTML = element[0].outerHTML; diff --git a/src/components/subheader/subheader.scss b/src/components/subheader/subheader.scss index 41818733b05..a3fe2d1af38 100644 --- a/src/components/subheader/subheader.scss +++ b/src/components/subheader/subheader.scss @@ -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; @@ -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; } }