| 1 |
/** |
| 2 |
* Dashboard styles. |
| 3 |
* |
| 4 |
* @wordpress/components carries the card, button and header chrome. What is |
| 5 |
* written here is what core has no component for — stat tiles, a status |
| 6 |
* banner, a progress checklist and the bottom card row — kept in WordPress's |
| 7 |
* own type scale and greys so they sit beside the components rather than |
| 8 |
* competing with them. |
| 9 |
*/ |
| 10 |
|
| 11 |
$border: #e0e0e0; |
| 12 |
$muted: #757575; |
| 13 |
$ink: #1e1e1e; |
| 14 |
|
| 15 |
.subscrpt-dash { |
| 16 |
max-width: 1240px; |
| 17 |
margin: 0 auto; |
| 18 |
padding-bottom: 8px; |
| 19 |
display: flex; |
| 20 |
flex-direction: column; |
| 21 |
gap: 16px; |
| 22 |
} |
| 23 |
|
| 24 |
.subscrpt-heading { |
| 25 |
font-size: 14px; |
| 26 |
font-weight: 600; |
| 27 |
color: $ink; |
| 28 |
margin: 0; |
| 29 |
padding: 0; |
| 30 |
line-height: 1.4; |
| 31 |
} |
| 32 |
|
| 33 |
.subscrpt-sub { |
| 34 |
font-size: 13px; |
| 35 |
color: $muted; |
| 36 |
margin: 4px 0 0; |
| 37 |
line-height: 1.5; |
| 38 |
} |
| 39 |
|
| 40 |
/* The Pro pill beside a link label; wpsubs-badge--pro gives it its look. */ |
| 41 |
.subscrpt-pro-badge { |
| 42 |
margin-inline-start: 6px; |
| 43 |
} |
| 44 |
|
| 45 |
/* -------------------------------------------------------------------------- |
| 46 |
Split: chart on the left, things that want doing on the right |
| 47 |
-------------------------------------------------------------------------- */ |
| 48 |
|
| 49 |
.subscrpt-dash { |
| 50 |
&__split { |
| 51 |
display: grid; |
| 52 |
grid-template-columns: minmax(0, 1fr) 340px; |
| 53 |
gap: 16px; |
| 54 |
align-items: start; |
| 55 |
} |
| 56 |
|
| 57 |
&__main { |
| 58 |
min-width: 0; |
| 59 |
} |
| 60 |
|
| 61 |
&__aside { |
| 62 |
display: flex; |
| 63 |
flex-direction: column; |
| 64 |
gap: 16px; |
| 65 |
min-width: 0; |
| 66 |
} |
| 67 |
} |
| 68 |
|
| 69 |
/* Below this the chart would be too narrow to read six months, so the aside |
| 70 |
drops underneath rather than squeezing it. */ |
| 71 |
@media screen and (max-width: 1100px) { |
| 72 |
.subscrpt-dash__split { |
| 73 |
grid-template-columns: minmax(0, 1fr); |
| 74 |
} |
| 75 |
} |
| 76 |
|
| 77 |
/* -------------------------------------------------------------------------- |
| 78 |
Monthly sales chart |
| 79 |
-------------------------------------------------------------------------- */ |
| 80 |
|
| 81 |
.subscrpt-chart { |
| 82 |
&__total { |
| 83 |
display: flex; |
| 84 |
align-items: baseline; |
| 85 |
gap: 8px; |
| 86 |
margin-bottom: 18px; |
| 87 |
} |
| 88 |
|
| 89 |
&__amount { |
| 90 |
font-size: 26px; |
| 91 |
font-weight: 400; |
| 92 |
color: $ink; |
| 93 |
line-height: 1.1; |
| 94 |
font-variant-numeric: tabular-nums; |
| 95 |
} |
| 96 |
|
| 97 |
&__caption { |
| 98 |
font-size: 12px; |
| 99 |
color: $muted; |
| 100 |
} |
| 101 |
|
| 102 |
&__empty { |
| 103 |
margin: 0; |
| 104 |
padding: 32px 0; |
| 105 |
text-align: center; |
| 106 |
font-size: 13px; |
| 107 |
color: $muted; |
| 108 |
} |
| 109 |
|
| 110 |
&__plot { |
| 111 |
display: grid; |
| 112 |
grid-auto-flow: column; |
| 113 |
grid-auto-columns: 1fr; |
| 114 |
gap: 10px; |
| 115 |
align-items: end; |
| 116 |
} |
| 117 |
|
| 118 |
&__col { |
| 119 |
display: flex; |
| 120 |
flex-direction: column; |
| 121 |
align-items: center; |
| 122 |
gap: 6px; |
| 123 |
min-width: 0; |
| 124 |
} |
| 125 |
|
| 126 |
/* Fixed-height rail so every column's baseline lines up whatever its bar |
| 127 |
does, and a month with nothing still holds its place. */ |
| 128 |
&__bar-wrap { |
| 129 |
display: flex; |
| 130 |
align-items: flex-end; |
| 131 |
height: 132px; |
| 132 |
width: 100%; |
| 133 |
} |
| 134 |
|
| 135 |
&__bar { |
| 136 |
display: block; |
| 137 |
width: 100%; |
| 138 |
max-width: 44px; |
| 139 |
margin: 0 auto; |
| 140 |
border-radius: 3px 3px 0 0; |
| 141 |
background: var(--wp-admin-theme-color, #3858e9); |
| 142 |
transition: opacity 0.12s; |
| 143 |
|
| 144 |
&.is-empty { |
| 145 |
height: 2px; |
| 146 |
background: #e0e0e0; |
| 147 |
border-radius: 2px; |
| 148 |
} |
| 149 |
} |
| 150 |
|
| 151 |
&__col:hover &__bar { |
| 152 |
opacity: 0.85; |
| 153 |
} |
| 154 |
|
| 155 |
&__value { |
| 156 |
font-size: 11px; |
| 157 |
color: $ink; |
| 158 |
font-variant-numeric: tabular-nums; |
| 159 |
white-space: nowrap; |
| 160 |
overflow: hidden; |
| 161 |
text-overflow: ellipsis; |
| 162 |
max-width: 100%; |
| 163 |
} |
| 164 |
|
| 165 |
&__month { |
| 166 |
font-size: 11px; |
| 167 |
color: $muted; |
| 168 |
} |
| 169 |
|
| 170 |
&__col:has(.subscrpt-chart__bar.is-empty) &__value { |
| 171 |
color: #c3c4c7; |
| 172 |
} |
| 173 |
} |
| 174 |
|
| 175 |
/* -------------------------------------------------------------------------- |
| 176 |
Stat tiles |
| 177 |
-------------------------------------------------------------------------- */ |
| 178 |
|
| 179 |
.subscrpt-tiles { |
| 180 |
display: grid; |
| 181 |
grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); |
| 182 |
gap: 12px; |
| 183 |
} |
| 184 |
|
| 185 |
.subscrpt-tile { |
| 186 |
position: relative; |
| 187 |
display: flex; |
| 188 |
flex-direction: column; |
| 189 |
gap: 2px; |
| 190 |
padding: 16px; |
| 191 |
border: 1px solid $border; |
| 192 |
border-radius: 8px; |
| 193 |
background: #f6f7f7; |
| 194 |
text-decoration: none; |
| 195 |
color: inherit; |
| 196 |
transition: |
| 197 |
background 0.12s, |
| 198 |
border-color 0.12s; |
| 199 |
|
| 200 |
&:hover { |
| 201 |
background: #fff; |
| 202 |
border-color: #c3c4c7; |
| 203 |
color: inherit; |
| 204 |
} |
| 205 |
|
| 206 |
&:focus { |
| 207 |
box-shadow: 0 0 0 2px var(--wp-admin-theme-color, #3858e9); |
| 208 |
outline: 2px solid transparent; |
| 209 |
color: inherit; |
| 210 |
} |
| 211 |
|
| 212 |
&__icon { |
| 213 |
position: absolute; |
| 214 |
top: 14px; |
| 215 |
right: 14px; |
| 216 |
color: #a7aaad; |
| 217 |
line-height: 0; |
| 218 |
} |
| 219 |
|
| 220 |
&__value { |
| 221 |
font-size: 30px; |
| 222 |
font-weight: 400; |
| 223 |
line-height: 1.15; |
| 224 |
font-variant-numeric: tabular-nums; |
| 225 |
color: var(--wp-admin-theme-color, #3858e9); |
| 226 |
} |
| 227 |
|
| 228 |
&__label { |
| 229 |
font-size: 12px; |
| 230 |
color: $muted; |
| 231 |
line-height: 1.4; |
| 232 |
padding-right: 20px; |
| 233 |
} |
| 234 |
|
| 235 |
/* Tone only ever marks a figure that is not zero, so a quiet store stays |
| 236 |
quiet instead of glowing amber at nothing. */ |
| 237 |
&.is-warning .subscrpt-tile__value { |
| 238 |
color: #bd8600; |
| 239 |
} |
| 240 |
|
| 241 |
&.is-error .subscrpt-tile__value { |
| 242 |
color: #cc1818; |
| 243 |
} |
| 244 |
} |
| 245 |
|
| 246 |
/* -------------------------------------------------------------------------- |
| 247 |
Health banner |
| 248 |
-------------------------------------------------------------------------- */ |
| 249 |
|
| 250 |
.subscrpt-banner { |
| 251 |
display: flex; |
| 252 |
align-items: flex-start; |
| 253 |
gap: 14px; |
| 254 |
flex-wrap: wrap; |
| 255 |
padding: 16px 18px; |
| 256 |
border: 1px solid $border; |
| 257 |
border-radius: 8px; |
| 258 |
background: #fff; |
| 259 |
|
| 260 |
&.is-clear { |
| 261 |
border-color: #b8e6c1; |
| 262 |
background: linear-gradient(90deg, #f2fcf5 0%, #fbfefc 60%); |
| 263 |
} |
| 264 |
|
| 265 |
&.is-attention { |
| 266 |
border-color: #f3d799; |
| 267 |
background: linear-gradient(90deg, #fffaf0 0%, #fffdf8 60%); |
| 268 |
} |
| 269 |
|
| 270 |
&__badge { |
| 271 |
display: inline-flex; |
| 272 |
align-items: center; |
| 273 |
justify-content: center; |
| 274 |
width: 44px; |
| 275 |
height: 44px; |
| 276 |
flex-shrink: 0; |
| 277 |
border-radius: 50%; |
| 278 |
background: #fff; |
| 279 |
border: 1px solid $border; |
| 280 |
} |
| 281 |
|
| 282 |
&.is-clear &__badge { |
| 283 |
color: #007017; |
| 284 |
border-color: #b8e6c1; |
| 285 |
} |
| 286 |
|
| 287 |
&.is-attention &__badge { |
| 288 |
color: #bd8600; |
| 289 |
border-color: #f3d799; |
| 290 |
} |
| 291 |
|
| 292 |
&__body { |
| 293 |
flex: 1; |
| 294 |
min-width: 0; |
| 295 |
} |
| 296 |
|
| 297 |
&__title { |
| 298 |
font-size: 15px; |
| 299 |
font-weight: 600; |
| 300 |
margin: 0; |
| 301 |
line-height: 1.4; |
| 302 |
} |
| 303 |
|
| 304 |
&.is-clear &__title { |
| 305 |
color: #007017; |
| 306 |
} |
| 307 |
|
| 308 |
&.is-attention &__title { |
| 309 |
color: #8a6116; |
| 310 |
} |
| 311 |
|
| 312 |
&__text { |
| 313 |
font-size: 13px; |
| 314 |
color: $muted; |
| 315 |
margin: 2px 0 0; |
| 316 |
line-height: 1.5; |
| 317 |
} |
| 318 |
} |
| 319 |
|
| 320 |
/* In the 340px column an action beside the text squeezes the title onto two |
| 321 |
lines and the sentence onto three, so it drops underneath, lined up with the |
| 322 |
text. A grid rather than a computed indent, so the badge's border never has |
| 323 |
to be counted. Below 1100px the column is full width again and the action |
| 324 |
goes back beside the text. */ |
| 325 |
@media screen and (min-width: 1101px) { |
| 326 |
.subscrpt-dash__aside .subscrpt-banner { |
| 327 |
display: grid; |
| 328 |
grid-template-columns: auto minmax(0, 1fr); |
| 329 |
align-items: start; |
| 330 |
|
| 331 |
> .components-button { |
| 332 |
grid-column: 2; |
| 333 |
justify-self: start; |
| 334 |
} |
| 335 |
} |
| 336 |
} |
| 337 |
|
| 338 |
/* -------------------------------------------------------------------------- |
| 339 |
Setup checklist |
| 340 |
-------------------------------------------------------------------------- */ |
| 341 |
|
| 342 |
.subscrpt-setup { |
| 343 |
&__count { |
| 344 |
font-size: 12px; |
| 345 |
color: $muted; |
| 346 |
white-space: nowrap; |
| 347 |
} |
| 348 |
|
| 349 |
/* Same amber as the attention banner, one step quieter: it sits inside a |
| 350 |
card rather than heading the column. */ |
| 351 |
&__warning { |
| 352 |
display: flex; |
| 353 |
align-items: flex-start; |
| 354 |
gap: 10px; |
| 355 |
margin-top: 14px; |
| 356 |
padding: 12px; |
| 357 |
border: 1px solid #f3d799; |
| 358 |
border-radius: 6px; |
| 359 |
background: #fffaf0; |
| 360 |
} |
| 361 |
|
| 362 |
&__warning-icon { |
| 363 |
display: inline-flex; |
| 364 |
flex-shrink: 0; |
| 365 |
margin-top: 1px; |
| 366 |
color: #bd8600; |
| 367 |
} |
| 368 |
|
| 369 |
&__warning-body { |
| 370 |
flex: 1; |
| 371 |
min-width: 0; |
| 372 |
} |
| 373 |
|
| 374 |
&__warning-title { |
| 375 |
font-size: 13px; |
| 376 |
font-weight: 600; |
| 377 |
color: #8a6116; |
| 378 |
margin: 0; |
| 379 |
line-height: 1.4; |
| 380 |
} |
| 381 |
|
| 382 |
&__warning-text { |
| 383 |
font-size: 12px; |
| 384 |
color: $muted; |
| 385 |
margin: 2px 0 8px; |
| 386 |
line-height: 1.5; |
| 387 |
} |
| 388 |
|
| 389 |
&__footer { |
| 390 |
margin-top: 14px; |
| 391 |
padding-top: 12px; |
| 392 |
border-top: 1px solid #f0f0f1; |
| 393 |
text-align: end; |
| 394 |
} |
| 395 |
|
| 396 |
&__wizard { |
| 397 |
display: inline-flex; |
| 398 |
align-items: center; |
| 399 |
gap: 5px; |
| 400 |
font-size: 13px; |
| 401 |
font-weight: 500; |
| 402 |
white-space: nowrap; |
| 403 |
text-decoration: none; |
| 404 |
color: var(--wp-admin-theme-color, #3858e9); |
| 405 |
|
| 406 |
&:hover, |
| 407 |
&:focus { |
| 408 |
text-decoration: underline; |
| 409 |
} |
| 410 |
} |
| 411 |
|
| 412 |
/* Done: one line — the count on the left, the way back into the wizard on |
| 413 |
the right. */ |
| 414 |
&__summary { |
| 415 |
display: flex; |
| 416 |
align-items: center; |
| 417 |
justify-content: space-between; |
| 418 |
gap: 12px; |
| 419 |
|
| 420 |
.subscrpt-setup__count { |
| 421 |
display: block; |
| 422 |
margin-top: 2px; |
| 423 |
} |
| 424 |
} |
| 425 |
} |
| 426 |
|
| 427 |
.subscrpt-progress { |
| 428 |
height: 4px; |
| 429 |
border-radius: 2px; |
| 430 |
background: #f0f0f1; |
| 431 |
overflow: hidden; |
| 432 |
margin-bottom: 4px; |
| 433 |
|
| 434 |
&__bar { |
| 435 |
display: block; |
| 436 |
height: 100%; |
| 437 |
border-radius: 2px; |
| 438 |
background: var(--wp-admin-theme-color, #3858e9); |
| 439 |
transition: width 0.2s; |
| 440 |
} |
| 441 |
} |
| 442 |
|
| 443 |
.subscrpt-steps { |
| 444 |
margin: 0; |
| 445 |
padding: 0; |
| 446 |
list-style: none; |
| 447 |
} |
| 448 |
|
| 449 |
.subscrpt-step { |
| 450 |
display: flex; |
| 451 |
align-items: center; |
| 452 |
gap: 12px; |
| 453 |
padding: 10px 0; |
| 454 |
margin: 0; |
| 455 |
border-bottom: 1px solid #f0f0f1; |
| 456 |
|
| 457 |
&:last-child { |
| 458 |
border-bottom: 0; |
| 459 |
padding-bottom: 0; |
| 460 |
} |
| 461 |
|
| 462 |
&__mark { |
| 463 |
display: inline-flex; |
| 464 |
align-items: center; |
| 465 |
justify-content: center; |
| 466 |
width: 20px; |
| 467 |
height: 20px; |
| 468 |
flex-shrink: 0; |
| 469 |
border-radius: 50%; |
| 470 |
border: 1px solid #c3c4c7; |
| 471 |
color: transparent; |
| 472 |
} |
| 473 |
|
| 474 |
&__label { |
| 475 |
flex: 1; |
| 476 |
font-size: 13px; |
| 477 |
color: $ink; |
| 478 |
line-height: 1.4; |
| 479 |
} |
| 480 |
|
| 481 |
&__state { |
| 482 |
font-size: 12px; |
| 483 |
color: $muted; |
| 484 |
} |
| 485 |
|
| 486 |
&.is-done &__mark { |
| 487 |
background: #007017; |
| 488 |
border-color: #007017; |
| 489 |
color: #fff; |
| 490 |
} |
| 491 |
|
| 492 |
&.is-done &__label { |
| 493 |
color: $muted; |
| 494 |
text-decoration: line-through; |
| 495 |
} |
| 496 |
} |
| 497 |
|
| 498 |
/* -------------------------------------------------------------------------- |
| 499 |
Build cards |
| 500 |
-------------------------------------------------------------------------- */ |
| 501 |
|
| 502 |
.subscrpt-build { |
| 503 |
padding: 20px; |
| 504 |
border: 1px solid $border; |
| 505 |
border-radius: 8px; |
| 506 |
background: #fff; |
| 507 |
|
| 508 |
&__grid { |
| 509 |
display: grid; |
| 510 |
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); |
| 511 |
gap: 12px; |
| 512 |
margin-top: 16px; |
| 513 |
} |
| 514 |
|
| 515 |
&__card { |
| 516 |
display: flex; |
| 517 |
flex-direction: column; |
| 518 |
padding: 18px; |
| 519 |
border: 1px solid $border; |
| 520 |
border-radius: 8px; |
| 521 |
text-decoration: none; |
| 522 |
color: inherit; |
| 523 |
background: #fff; |
| 524 |
transition: |
| 525 |
border-color 0.12s, |
| 526 |
box-shadow 0.12s; |
| 527 |
|
| 528 |
&:hover { |
| 529 |
border-color: #c3c4c7; |
| 530 |
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06); |
| 531 |
color: inherit; |
| 532 |
} |
| 533 |
|
| 534 |
&:focus { |
| 535 |
box-shadow: 0 0 0 2px var(--wp-admin-theme-color, #3858e9); |
| 536 |
outline: 2px solid transparent; |
| 537 |
color: inherit; |
| 538 |
} |
| 539 |
} |
| 540 |
|
| 541 |
&__icon { |
| 542 |
display: inline-flex; |
| 543 |
align-items: center; |
| 544 |
justify-content: center; |
| 545 |
width: 36px; |
| 546 |
height: 36px; |
| 547 |
border-radius: 8px; |
| 548 |
margin-bottom: 14px; |
| 549 |
background: #f0f0f1; |
| 550 |
color: #50575e; |
| 551 |
} |
| 552 |
|
| 553 |
&__eyebrow { |
| 554 |
font-size: 11px; |
| 555 |
font-weight: 600; |
| 556 |
letter-spacing: 0.06em; |
| 557 |
text-transform: uppercase; |
| 558 |
color: $muted; |
| 559 |
|
| 560 |
// Kept inside the eyebrow's own line height, so a card carrying the pill |
| 561 |
// does not push its title below the titles of the cards beside it. The |
| 562 |
// space before it already separates the two. |
| 563 |
.subscrpt-pro-badge { |
| 564 |
line-height: 1; |
| 565 |
padding-block: 1px; |
| 566 |
margin-inline-start: 2px; |
| 567 |
} |
| 568 |
} |
| 569 |
|
| 570 |
&__title { |
| 571 |
font-size: 15px; |
| 572 |
font-weight: 600; |
| 573 |
color: $ink; |
| 574 |
margin-top: 2px; |
| 575 |
line-height: 1.4; |
| 576 |
} |
| 577 |
|
| 578 |
&__text { |
| 579 |
font-size: 13px; |
| 580 |
color: $muted; |
| 581 |
line-height: 1.5; |
| 582 |
margin-top: 6px; |
| 583 |
} |
| 584 |
|
| 585 |
&__link { |
| 586 |
display: inline-flex; |
| 587 |
align-items: center; |
| 588 |
gap: 5px; |
| 589 |
font-size: 13px; |
| 590 |
font-weight: 500; |
| 591 |
margin-top: 14px; |
| 592 |
color: var(--wp-admin-theme-color, #3858e9); |
| 593 |
} |
| 594 |
|
| 595 |
/* One accent per card, so the three read as different doors rather than |
| 596 |
three copies of the same one. */ |
| 597 |
&__card.is-setup &__icon { |
| 598 |
background: #edfaef; |
| 599 |
color: #007017; |
| 600 |
} |
| 601 |
|
| 602 |
&__card.is-setup &__link { |
| 603 |
color: #007017; |
| 604 |
} |
| 605 |
|
| 606 |
&__card.is-extend &__icon { |
| 607 |
background: #f3eefc; |
| 608 |
color: #6c2eb9; |
| 609 |
} |
| 610 |
|
| 611 |
&__card.is-extend &__link { |
| 612 |
color: #6c2eb9; |
| 613 |
} |
| 614 |
} |
| 615 |
|
| 616 |
/* -------------------------------------------------------------------------- |
| 617 |
Footer links |
| 618 |
-------------------------------------------------------------------------- */ |
| 619 |
|
| 620 |
.subscrpt-footer { |
| 621 |
text-align: center; |
| 622 |
font-size: 13px; |
| 623 |
margin: 4px 0 0; |
| 624 |
color: $muted; |
| 625 |
|
| 626 |
a { |
| 627 |
display: inline-flex; |
| 628 |
align-items: center; |
| 629 |
gap: 4px; |
| 630 |
text-decoration: none; |
| 631 |
} |
| 632 |
|
| 633 |
&__sep { |
| 634 |
margin: 0 10px; |
| 635 |
color: #c3c4c7; |
| 636 |
} |
| 637 |
} |
| 638 |
|
| 639 |
@media screen and (max-width: 782px) { |
| 640 |
.subscrpt-banner { |
| 641 |
flex-wrap: wrap; |
| 642 |
} |
| 643 |
} |
| 644 |
|