|
1 | 1 | .header-main { |
2 | | - // position:fixed; // for header scroll |
3 | | - position: sticky; |
| 2 | + position: fixed; |
4 | 3 | top: 0; |
5 | | - width: 100%; |
| 4 | + left: 0; |
| 5 | + right: 0; |
6 | 6 | z-index: 999; |
7 | 7 | .button a { |
8 | 8 | color: inherit; |
9 | 9 | } |
10 | 10 | } |
11 | 11 |
|
12 | | -// offset in both states, or the header drops 32px out from behind the admin bar the |
13 | | -// moment it goes small. Core stops pinning the bar below 601px, where an offset would |
14 | | -// leave a gap once it scrolls away. |
| 12 | +.header--spacer { |
| 13 | + height: $headerInnerHeight; |
| 14 | +} |
| 15 | + |
| 16 | +html { |
| 17 | + scroll-padding-top: calc(#{$headerInnerHeight} + var(--wp-admin--admin-bar--height, 0px)); |
| 18 | +} |
| 19 | + |
15 | 20 | .admin-bar .header-main { |
16 | | - @media only screen and (min-width: 601px) { |
17 | | - top: var(--wp-admin--admin-bar--height, 32px); |
18 | | - } |
| 21 | + top: var(--wp-admin--admin-bar--height, 32px); |
19 | 22 | } |
20 | 23 |
|
21 | 24 | .header-main { |
|
26 | 29 | height: $headerInnerHeight; |
27 | 30 | display: flex; |
28 | 31 | align-items: center; |
| 32 | + transition: height .3s; |
29 | 33 | @media only screen and (max-width: #{$break-nav - 0.06}) { |
30 | 34 | background: #fff; |
31 | 35 | padding: 16px; |
|
116 | 120 | } |
117 | 121 |
|
118 | 122 | @media only screen and (min-width: #{$break-nav}) { |
119 | | - .header--inner, |
120 | 123 | .header--quicklinks-inner { |
121 | 124 | // @include clearfix(); |
122 | 125 | padding-left: $maxPadding; |
|
125 | 128 | .header--inner { |
126 | 129 | border: 0; |
127 | 130 | position: relative; |
| 131 | + padding-left: calc(#{$wrapperPad} + #{$maxPadding}); |
| 132 | + padding-right: calc(#{$wrapperPad} + #{$maxPadding}); |
| 133 | + } |
| 134 | + .header-main-small { |
| 135 | + .header--inner { |
| 136 | + height: $headerInnerHeightSmall; |
| 137 | + } |
| 138 | + .nav-main { |
| 139 | + padding-bottom: $navPadSmall; |
| 140 | + padding-top: $navPadSmall; |
| 141 | + } |
128 | 142 | } |
129 | 143 | .header--blog-name { |
130 | 144 | // hold the column at full-logo width: letting it shrink with the logo hands the |
|
144 | 158 | clear: right; |
145 | 159 | padding: 0; |
146 | 160 | } |
147 | | - // full-bleed white: ::after escapes the wrapper inset so the background spans the |
148 | | - // page, which the design asks for whenever the header is white |
149 | 161 | @mixin header-white-veil( $border: false ) { |
150 | 162 | &::after { |
151 | 163 | background-color: $Nwhite; |
152 | 164 | @if $border { |
153 | 165 | border-bottom: 1px solid $Nlight; |
154 | 166 | } |
155 | 167 | content: ''; |
156 | | - inset: 0 (-$wrapperPad); |
| 168 | + inset: 0; |
157 | 169 | position: absolute; |
158 | 170 | z-index: -1; |
159 | 171 | } |
|
0 commit comments