-
Notifications
You must be signed in to change notification settings - Fork 27
/
header.pcss
190 lines (157 loc) · 4.13 KB
/
header.pcss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
html {
--wp-global-header-height: 60px;
@media (--tablet) {
--wp-global-header-height: 90px;
}
@media (--short-screen) {
--wp-global-header-height: 60px;
}
}
/*
* Fix iOS Safari scrolling bug. These styles have no other purpose.
* @link https://github.com/WordPress/wporg-mu-plugins/issues/371.
*/
html.has-modal-open {
/*
* Hotfix for https://github.com/WordPress/gutenberg/pull/49369/. Otherwise the styles below will break when
* we update. Remove this after we install the update
*/
position: fixed;
/*
* Override https://github.com/WordPress/gutenberg/pull/49369/. On desktop views it causes a gap to the right
* of the search modal when it's open.
*/
position: static;
@media (--mobile-only) {
height: 100lvh;
overflow: hidden;
& body:not(.admin-bar) {
background: var(--wp--preset--color--charcoal-5);
}
& .wp-site-blocks {
position: fixed;
height: 100vh;
overflow: hidden;
}
& .wp-block-navigation__responsive-container {
height: 100vh;
}
& #wpadminbar {
position: fixed;
}
}
}
.wp-block-group.global-header {
display: flex;
align-items: flex-start;
font-size: 21px;
height: var(--wp-global-header-height);
padding: 0;
box-sizing: content-box; /* Don't include border in header height. */
/*
* Some themes set a `z-index` on content elements that follow the header, like `#masthead` in
* `wporg-learn-2020`. If the global header doesn't have a higher index, then submenus will be
* covered up by the content when you hover over the parent menu item.
*/
position: relative;
z-index: 250;
@media (--tablet) {
position: fixed;
top: var(--wp-admin--admin-bar--height, 0);
left: 0;
right: 0;
font-size: var(--wp--preset--font-size--small);
line-height: 24px;
}
& > * {
flex-shrink: 0;
padding-left: var(--wp--style--block-gap);
padding-right: var(--wp--style--block-gap);
margin: 0;
@media (--tablet) {
padding-top: 33px;
padding-bottom: 33px;
}
}
& .global-header__search,
& .global-header__navigation {
padding: 0;
& .wp-block-navigation__responsive-container-open {
/* Magic numbers to center the 24px icon in 60px height. */
padding: 18px 16px 18px;
@media (--tablet) {
padding-top: 37px;
padding-bottom: 37px;
}
}
}
& button {
background-color: transparent;
border: none;
}
& .global-header__search-container,
& .global-header__menu-container {
flex-basis: calc(25px + ( var(--wp--style--block-gap) * 2 ));
text-align: center;
}
& .global-header__close-search,
& .global-header__close-menu {
display: none;
}
& .wp-block-navigation__responsive-container-close {
position: fixed;
right: 0;
top: calc(-1 * var(--wp-global-header-height));
padding-top: 18px; /* Magic numbers to center the 24px icon in 60px height. */
padding-right: calc(16px + var(--wp--custom--alignment--scroll-bar-width));
padding-bottom: 18px; /* Magic numbers to center the 24px icon in 60px height. */
padding-left: 16px;
background-color: var(--wp-global-header--background-color--hover);
}
}
.global-header__alert-banner {
--wp-global-header--link-color: var(--wp--preset--color--blueberry-1);
background-color: var(--wp--preset--color--blueberry-4);
color: var(--wp--preset--color--charcoal-1);
font-size: 12px;
line-height: 1.2;
text-align: center;
margin: 0;
padding: 10px 20px;
& p {
color: inherit; /* Override some Classic themes. */
&:first-child {
margin-top: 0;
}
&:last-child {
margin-bottom: 0;
}
}
& a:hover,
& a:focus {
/* !important is needed because the build process wraps some of the selectors in `_common.pcss` in an
* `:is()` pseudo-class, which increases their specificity.
*/
color: var(--wp-global-header--link-color) !important;
}
}
/*
* Gutenberg Patches
*
* See: https://github.com/WordPress/wporg-mu-plugins/issues/216
*/
.has-modal-open .admin-bar .wp-block-navigation__responsive-dialog,
.wp-block-group.global-header .has-modal-open .wp-block-navigation__responsive-dialog {
margin-top: 0;
}
@media (--short-screen) {
.wp-block-group.global-header {
& > * {
padding-top: 20px;
padding-bottom: 20px;
}
& > nav {
padding-bottom: 0;
}
}
}