| 1 |
@use 'theme'; |
| 2 |
@use 'upsell'; |
| 3 |
|
| 4 |
$toolbar-block-size: 136px; |
| 5 |
$wpcontent-inline-start-indent: 20px; |
| 6 |
|
| 7 |
#wpbody { |
| 8 |
padding-block-start: $toolbar-block-size; |
| 9 |
} |
| 10 |
|
| 11 |
.code-snippets-toolbar { |
| 12 |
color: #2c3337; |
| 13 |
background: #fff; |
| 14 |
font-family: 'SF Pro', sans-serif; |
| 15 |
margin-inline-start: -$wpcontent-inline-start-indent - 2; |
| 16 |
position: absolute; |
| 17 |
inline-size: calc(100% + $wpcontent-inline-start-indent); |
| 18 |
block-size: $toolbar-block-size; |
| 19 |
inset-block-start: 0; |
| 20 |
display: flex; |
| 21 |
flex-direction: column; |
| 22 |
|
| 23 |
ul, li { |
| 24 |
margin: 0; |
| 25 |
padding: 0; |
| 26 |
list-style: none; |
| 27 |
} |
| 28 |
} |
| 29 |
|
| 30 |
.code-snippets-toolbar-upper { |
| 31 |
justify-content: space-between; |
| 32 |
block-size: 76px; |
| 33 |
box-sizing: border-box; |
| 34 |
padding-block: 16px; |
| 35 |
padding-inline: 24px; |
| 36 |
border-block-end: 1px solid rgb(195 196 199 / 50%); |
| 37 |
display: flex; |
| 38 |
align-items: center; |
| 39 |
|
| 40 |
.logo { |
| 41 |
display: flex; |
| 42 |
align-items: center; |
| 43 |
gap: 8px; |
| 44 |
|
| 45 |
img { |
| 46 |
block-size: 42px; |
| 47 |
} |
| 48 |
|
| 49 |
div { |
| 50 |
font-size: 18px; |
| 51 |
font-weight: 700; |
| 52 |
} |
| 53 |
} |
| 54 |
|
| 55 |
h1 { |
| 56 |
font-size: 18px; |
| 57 |
font-weight: 700; |
| 58 |
line-height: 1.5; |
| 59 |
} |
| 60 |
|
| 61 |
ul { |
| 62 |
display: flex; |
| 63 |
gap: 22px; |
| 64 |
align-items: center; |
| 65 |
} |
| 66 |
|
| 67 |
a { |
| 68 |
color: inherit; |
| 69 |
text-decoration: none; |
| 70 |
} |
| 71 |
|
| 72 |
@media (width <= 480px) { |
| 73 |
padding-inline: 10px; |
| 74 |
|
| 75 |
.logo img { |
| 76 |
block-size: 34px; |
| 77 |
} |
| 78 |
|
| 79 |
.logo div { |
| 80 |
display: none; |
| 81 |
} |
| 82 |
|
| 83 |
.toolbar-upgrade-item .button { |
| 84 |
padding-inline: 10px; |
| 85 |
} |
| 86 |
} |
| 87 |
} |
| 88 |
|
| 89 |
.code-snippets-toolbar-lower { |
| 90 |
border-block-end: 1px solid #e2e2e4; |
| 91 |
block-size: 60px; |
| 92 |
box-sizing: border-box; |
| 93 |
|
| 94 |
nav, |
| 95 |
ul { |
| 96 |
block-size: 100%; |
| 97 |
} |
| 98 |
|
| 99 |
ul { |
| 100 |
display: flex; |
| 101 |
align-items: stretch; |
| 102 |
} |
| 103 |
|
| 104 |
li { |
| 105 |
display: flex; |
| 106 |
} |
| 107 |
|
| 108 |
// Items fill the 60px band; the active tab is indicated by accent colour on |
| 109 |
// its icon and label, with no underline. |
| 110 |
li a { |
| 111 |
display: flex; |
| 112 |
margin: 0; |
| 113 |
block-size: 100%; |
| 114 |
padding-block: 0; |
| 115 |
padding-inline: 24px; |
| 116 |
color: #2c3337; |
| 117 |
gap: 12px; |
| 118 |
align-items: center; |
| 119 |
font-size: 16px; |
| 120 |
font-weight: 600; |
| 121 |
letter-spacing: -0.16px; |
| 122 |
text-decoration: none; |
| 123 |
box-sizing: border-box; |
| 124 |
cursor: pointer; |
| 125 |
|
| 126 |
svg { |
| 127 |
inline-size: 26px; |
| 128 |
block-size: 26px; |
| 129 |
} |
| 130 |
|
| 131 |
&.active-link, &:hover, &:focus, &:active { |
| 132 |
color: theme.$accent; |
| 133 |
z-index: 1; |
| 134 |
} |
| 135 |
} |
| 136 |
|
| 137 |
li:not(.toolbar-end-item) + li.toolbar-end-item { |
| 138 |
margin-inline-start: auto; |
| 139 |
} |
| 140 |
|
| 141 |
// Narrow widths: centre each item's label directly beneath its icon and |
| 142 |
// shrink the type so the nav still fits on one row. The pro chip becomes a |
| 143 |
// small badge pinned to the item's top corner, out of the flow so it never |
| 144 |
// shifts the icon off-centre from its label. Below 782px the row scrolls |
| 145 |
// sideways (see the mobile block below) rather than wrapping. |
| 146 |
@media (width <= 1140px) { |
| 147 |
li a { |
| 148 |
position: relative; |
| 149 |
flex-direction: column; |
| 150 |
justify-content: center; |
| 151 |
align-items: center; |
| 152 |
gap: 4px; |
| 153 |
padding-inline: 14px; |
| 154 |
font-size: 13px; |
| 155 |
text-align: center; |
| 156 |
|
| 157 |
.pro-chip { |
| 158 |
position: absolute; |
| 159 |
inset-block-start: 7px; |
| 160 |
inset-inline-end: 4px; |
| 161 |
padding-block: 1px; |
| 162 |
padding-inline: 5px; |
| 163 |
font-size: 8px; |
| 164 |
line-height: normal; |
| 165 |
} |
| 166 |
} |
| 167 |
} |
| 168 |
|
| 169 |
// On narrow screens Settings remains available through the WordPress submenu. |
| 170 |
// The remaining primary destinations fill the toolbar evenly rather than |
| 171 |
// becoming a second horizontally-scrolling navigation row. |
| 172 |
@media (width <= 782px) { |
| 173 |
li.toolbar-end-item { |
| 174 |
display: none; |
| 175 |
} |
| 176 |
|
| 177 |
li:not(.toolbar-end-item) { |
| 178 |
flex: 1 1 0; |
| 179 |
min-inline-size: 0; |
| 180 |
} |
| 181 |
|
| 182 |
li:not(.toolbar-end-item) + li.toolbar-end-item { |
| 183 |
margin-inline-start: 0; |
| 184 |
} |
| 185 |
|
| 186 |
li a { |
| 187 |
inline-size: 100%; |
| 188 |
padding-inline: 8px; |
| 189 |
white-space: normal; |
| 190 |
} |
| 191 |
} |
| 192 |
} |
| 193 |
|
| 194 |
.code-snippets-toolbar-upper li a.active-link, |
| 195 |
.code-snippets-toolbar-upper li a:hover, |
| 196 |
.code-snippets-toolbar-upper li a:focus, |
| 197 |
.code-snippets-toolbar-upper li a:active { |
| 198 |
color: theme.$accent; |
| 199 |
} |
| 200 |
|
| 201 |
.code-snippets-toolbar-lower .pro-chip, |
| 202 |
.nav-tab .pro-chip, |
| 203 |
.snippet-type-link .pro-chip { |
| 204 |
color: theme.$accent; |
| 205 |
background: #eff5f9; |
| 206 |
border: 1px solid rgb(34 113 177 / 10%); |
| 207 |
text-transform: uppercase; |
| 208 |
border-radius: 999px; |
| 209 |
display: flex; |
| 210 |
justify-content: center; |
| 211 |
align-items: center; |
| 212 |
box-sizing: border-box; |
| 213 |
padding: 5px 12px; |
| 214 |
font-weight: 700; |
| 215 |
line-height: 1; |
| 216 |
} |
| 217 |
|
| 218 |
|
| 219 |
.code-snippets-toolbar-lower .pro-chip { |
| 220 |
font-size: 12px; |
| 221 |
} |
| 222 |
|
| 223 |
.nav-tab .pro-chip, |
| 224 |
.snippet-type-link .pro-chip { |
| 225 |
font-size: 10px; |
| 226 |
} |
| 227 |
|
| 228 |
.code-snippets-return-link { |
| 229 |
float: inline-end; |
| 230 |
} |
| 231 |
|
| 232 |
.code-snippets-toolbar-upper .toolbar-more-item { |
| 233 |
display: none; |
| 234 |
} |
| 235 |
|
| 236 |
.code-snippets-toolbar-upper .toolbar-more-menu { |
| 237 |
position: relative; |
| 238 |
|
| 239 |
.dashicons, .dashicons::before { |
| 240 |
inline-size: 16px; |
| 241 |
block-size: 16px; |
| 242 |
font-size: 16px; |
| 243 |
} |
| 244 |
} |
| 245 |
|
| 246 |
.code-snippets-toolbar-upper .toolbar-more-menu summary { |
| 247 |
display: inline-flex; |
| 248 |
align-items: center; |
| 249 |
gap: 4px; |
| 250 |
cursor: pointer; |
| 251 |
} |
| 252 |
|
| 253 |
.code-snippets-toolbar-upper .toolbar-more-menu ul { |
| 254 |
position: absolute; |
| 255 |
inset-block-start: calc(100% + 8px); |
| 256 |
inset-inline-end: 0; |
| 257 |
z-index: 2; |
| 258 |
display: grid; |
| 259 |
min-inline-size: 180px; |
| 260 |
block-size: auto; |
| 261 |
margin: 0; |
| 262 |
padding: 8px; |
| 263 |
background: #fff; |
| 264 |
border: 1px solid theme.$control-border; |
| 265 |
box-shadow: 0 3px 8px rgb(0 0 0 / 15%); |
| 266 |
} |
| 267 |
|
| 268 |
.code-snippets-toolbar-upper .toolbar-more-menu li { |
| 269 |
margin: 0; |
| 270 |
} |
| 271 |
|
| 272 |
// The upper and lower toolbars are distinct navigation trees; keep this rule |
| 273 |
// after the lower-toolbar link state rules so the compact menu owns its hover state. |
| 274 |
// stylelint-disable-next-line no-descending-specificity |
| 275 |
.code-snippets-toolbar-upper .toolbar-more-menu a { |
| 276 |
display: block; |
| 277 |
padding: 8px; |
| 278 |
white-space: nowrap; |
| 279 |
} |
| 280 |
|
| 281 |
.code-snippets-toolbar-upper .toolbar-more-menu a:hover, |
| 282 |
.code-snippets-toolbar-upper .toolbar-more-menu a:focus { |
| 283 |
background: #f6f7f7; |
| 284 |
} |
| 285 |
|
| 286 |
@media (width <= 960px) { |
| 287 |
.code-snippets-toolbar-upper { |
| 288 |
gap: 12px; |
| 289 |
padding-inline: 16px; |
| 290 |
} |
| 291 |
|
| 292 |
.code-snippets-toolbar-upper .logo { |
| 293 |
flex: 0 1 auto; |
| 294 |
min-inline-size: 0; |
| 295 |
} |
| 296 |
|
| 297 |
.code-snippets-toolbar-upper nav { |
| 298 |
margin-inline-start: auto; |
| 299 |
} |
| 300 |
|
| 301 |
.code-snippets-toolbar-upper > nav > ul { |
| 302 |
gap: 8px; |
| 303 |
} |
| 304 |
|
| 305 |
.code-snippets-toolbar-upper > nav > ul > li:not(.toolbar-upgrade-item, .toolbar-more-item) { |
| 306 |
display: none; |
| 307 |
} |
| 308 |
|
| 309 |
.code-snippets-toolbar-upper .toolbar-more-item { |
| 310 |
display: flex; |
| 311 |
} |
| 312 |
|
| 313 |
.code-snippets-toolbar-upper .toolbar-more-menu summary { |
| 314 |
padding: 8px; |
| 315 |
white-space: nowrap; |
| 316 |
} |
| 317 |
|
| 318 |
.code-snippets-toolbar-upper .toolbar-upgrade-item .button { |
| 319 |
display: block; |
| 320 |
max-inline-size: 180px; |
| 321 |
overflow: hidden; |
| 322 |
text-overflow: ellipsis; |
| 323 |
white-space: nowrap; |
| 324 |
} |
| 325 |
} |
| 326 |
|
| 327 |
@media (width <= 640px) { |
| 328 |
.code-snippets-toolbar-upper .logo div { |
| 329 |
display: none; |
| 330 |
} |
| 331 |
} |
| 332 |
|