| @@ -1,9 +1,4 @@ | ||
| 1 | -/* Tabs */ | |
| 2 | -#post-body-content .ui-tabs-nav { | |
| 3 | - border-bottom: 1px solid #c3c4c7; | |
| 4 | -} | |
| 5 | - | |
| 6 | 1 | /* General styles for the repeater wrapper */ |
| 7 | 2 | .wz-repeater-wrapper { |
| 8 | 3 | position: relative; |
| 9 | 4 | margin-bottom: 1.5rem; |
| @@ -23,14 +18,28 @@ | ||
| 23 | 18 | .wz-repeater-item .repeater-item-header { |
| 24 | 19 | display: flex; |
| 25 | 20 | justify-content: space-between; |
| 26 | 21 | align-items: center; |
| 22 | + width: 100%; | |
| 23 | + margin: 0; | |
| 24 | + background: transparent; | |
| 25 | + color: inherit; | |
| 26 | + font: inherit; | |
| 27 | + text-align: start; | |
| 27 | 28 | border-bottom: 1px solid #ddd; |
| 29 | + border-top: 0; | |
| 30 | + border-right: 0; | |
| 31 | + border-left: 0; | |
| 28 | 32 | padding-bottom: 0.5rem; |
| 29 | 33 | cursor: pointer; |
| 30 | 34 | font-weight: bold; |
| 31 | 35 | } |
| 32 | 36 | |
| 37 | +.wz-repeater-item .repeater-item-header:focus-visible { | |
| 38 | + outline: 2px solid #2271b1; | |
| 39 | + outline-offset: 2px; | |
| 40 | +} | |
| 41 | + | |
| 33 | 42 | /* Header for repeater field */ |
| 34 | 43 | .wz-repeater-field-header { |
| 35 | 44 | margin-bottom: 0.5rem; |
| 36 | 45 | } |
| @@ -110,8 +119,22 @@ | ||
| 110 | 119 | .repeater-template { |
| 111 | 120 | display: none; |
| 112 | 121 | } |
| 113 | 122 | |
| 123 | +/* Disabled / pro-gated repeater: the subfields and the repeater's own buttons each | |
| 124 | + carry a disabled attribute, which is what actually blocks interaction. These rules | |
| 125 | + only supply the matching visual affordance on the wrapper, which cannot be disabled. */ | |
| 126 | +.wz-repeater-disabled .add-item, | |
| 127 | +.wz-repeater-disabled .repeater-item-actions .button { | |
| 128 | + pointer-events: none; | |
| 129 | + opacity: 0.5; | |
| 130 | + cursor: not-allowed; | |
| 131 | +} | |
| 132 | + | |
| 133 | +.wz-repeater-disabled .add-item:hover { | |
| 134 | + background-color: #0073aa; | |
| 135 | +} | |
| 136 | + | |
| 114 | 137 | /* Responsiveness for smaller screens */ |
| 115 | 138 | @media screen and (max-width: 768px) { |
| 116 | 139 | .wz-repeater-wrapper { |
| 117 | 140 | margin-bottom: 1rem; |
| @@ -277,5 +300,377 @@ | ||
| 277 | 300 | top: 50%; |
| 278 | 301 | right: 8px; |
| 279 | 302 | transform: translateY(-50%); |
| 280 | 303 | font-size: 2em; |
| 281 | -} | |
| 304 | +} | |
| 305 | +/* Toggle switch field type. */ | |
| 306 | +.wz-toggle { | |
| 307 | + position: relative; | |
| 308 | + display: inline-block; | |
| 309 | + width: 40px; | |
| 310 | + height: 22px; | |
| 311 | + vertical-align: middle; | |
| 312 | +} | |
| 313 | + | |
| 314 | +.wz-toggle input[type="checkbox"] { | |
| 315 | + position: absolute; | |
| 316 | + opacity: 0; | |
| 317 | + width: 100%; | |
| 318 | + height: 100%; | |
| 319 | + margin: 0; | |
| 320 | + cursor: pointer; | |
| 321 | +} | |
| 322 | + | |
| 323 | +.wz-toggle .wz-toggle-slider { | |
| 324 | + position: absolute; | |
| 325 | + inset: 0; | |
| 326 | + background-color: #8c8f94; | |
| 327 | + border-radius: 11px; | |
| 328 | + transition: background-color 0.2s ease; | |
| 329 | + pointer-events: none; | |
| 330 | +} | |
| 331 | + | |
| 332 | +.wz-toggle .wz-toggle-slider::before { | |
| 333 | + content: ""; | |
| 334 | + position: absolute; | |
| 335 | + top: 2px; | |
| 336 | + left: 2px; | |
| 337 | + width: 18px; | |
| 338 | + height: 18px; | |
| 339 | + background-color: #fff; | |
| 340 | + border-radius: 50%; | |
| 341 | + transition: transform 0.2s ease; | |
| 342 | +} | |
| 343 | + | |
| 344 | +.wz-toggle input[type="checkbox"]:checked + .wz-toggle-slider { | |
| 345 | + background-color: #2271b1; | |
| 346 | +} | |
| 347 | + | |
| 348 | +.wz-toggle input[type="checkbox"]:checked + .wz-toggle-slider::before { | |
| 349 | + transform: translateX(18px); | |
| 350 | +} | |
| 351 | + | |
| 352 | +.wz-toggle input[type="checkbox"]:focus-visible + .wz-toggle-slider { | |
| 353 | + outline: 2px solid #2271b1; | |
| 354 | + outline-offset: 2px; | |
| 355 | +} | |
| 356 | + | |
| 357 | +.wz-toggle input[type="checkbox"]:disabled { | |
| 358 | + cursor: not-allowed; | |
| 359 | +} | |
| 360 | + | |
| 361 | +.wz-toggle input[type="checkbox"]:disabled + .wz-toggle-slider { | |
| 362 | + opacity: 0.5; | |
| 363 | +} | |
| 364 | + | |
| 365 | +/* | |
| 366 | + * Settings page layout: content + sidebar, side by side. | |
| 367 | + * | |
| 368 | + * WP core lays out #post-body-content and #postbox-container-1 via floats, but a float can | |
| 369 | + * only avoid floats that precede it in source order — #post-body-content comes first, so it | |
| 370 | + * has nothing to avoid and renders at full width, overlapping the sidebar that floats beside | |
| 371 | + * it. Flexbox sidesteps the ordering problem entirely and (with align-items: flex-start) still | |
| 372 | + * lets the sidebar be shorter than the tab content, matching the old float layout's look. | |
| 373 | + */ | |
| 374 | +#post-body.wz-settings-post-body { | |
| 375 | + display: flex; | |
| 376 | + align-items: flex-start; | |
| 377 | + gap: 24px; | |
| 378 | +} | |
| 379 | + | |
| 380 | +#post-body.wz-settings-post-body > #postbox-container-1 { | |
| 381 | + flex: 0 0 280px; | |
| 382 | + width: 280px; | |
| 383 | +} | |
| 384 | + | |
| 385 | +/* Vertical settings tabs. */ | |
| 386 | +.wz-vertical-tabs { | |
| 387 | + display: flex; | |
| 388 | + align-items: flex-start; | |
| 389 | + flex: 1 1 auto; | |
| 390 | + min-width: 0; | |
| 391 | + gap: 24px; | |
| 392 | +} | |
| 393 | + | |
| 394 | +.wz-vertical-tabs > ul.nav-tab-wrapper { | |
| 395 | + flex: 0 0 auto; | |
| 396 | + width: fit-content; | |
| 397 | + min-width: 160px; | |
| 398 | + max-width: 260px; | |
| 399 | + display: flex; | |
| 400 | + flex-direction: column; | |
| 401 | + gap: 2px; | |
| 402 | + align-self: flex-start; | |
| 403 | + margin: 0; | |
| 404 | + padding: 8px; | |
| 405 | + background: #fff; | |
| 406 | + border: 1px solid #c3c4c7; | |
| 407 | + border-radius: 4px; | |
| 408 | + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04); | |
| 409 | + position: sticky; | |
| 410 | + top: 46px; | |
| 411 | +} | |
| 412 | + | |
| 413 | +.wz-vertical-tabs > ul.nav-tab-wrapper li { | |
| 414 | + margin: 0; | |
| 415 | + padding: 0; | |
| 416 | + border: 0; | |
| 417 | + background: transparent; | |
| 418 | + list-style: none; | |
| 419 | +} | |
| 420 | + | |
| 421 | +.wz-vertical-tabs > ul.nav-tab-wrapper .nav-tab { | |
| 422 | + display: block; | |
| 423 | + float: none; | |
| 424 | + margin: 0; | |
| 425 | + padding: 8px 12px; | |
| 426 | + border: none; | |
| 427 | + border-radius: 3px; | |
| 428 | + background: transparent; | |
| 429 | + color: #2c3338; | |
| 430 | + font-weight: 500; | |
| 431 | + transition: background-color 0.15s ease, color 0.15s ease; | |
| 432 | +} | |
| 433 | + | |
| 434 | +.wz-vertical-tabs > ul.nav-tab-wrapper .nav-tab:hover { | |
| 435 | + background-color: #f0f0f1; | |
| 436 | + color: #2271b1; | |
| 437 | + box-shadow: none; | |
| 438 | +} | |
| 439 | + | |
| 440 | +.wz-vertical-tabs > ul.nav-tab-wrapper .nav-tab:focus-visible { | |
| 441 | + outline: 2px solid #2271b1; | |
| 442 | + outline-offset: -2px; | |
| 443 | + box-shadow: none; | |
| 444 | +} | |
| 445 | + | |
| 446 | +.wz-vertical-tabs > ul.nav-tab-wrapper .nav-tab-active, | |
| 447 | +.wz-vertical-tabs > ul.nav-tab-wrapper .nav-tab-active:hover, | |
| 448 | +.wz-vertical-tabs > ul.nav-tab-wrapper .nav-tab-active:focus { | |
| 449 | + background-color: #2271b1; | |
| 450 | + color: #fff; | |
| 451 | +} | |
| 452 | + | |
| 453 | +.wz-vertical-tabs > form { | |
| 454 | + flex: 1; | |
| 455 | + min-width: 0; | |
| 456 | + margin-top: 0; | |
| 457 | +} | |
| 458 | + | |
| 459 | +/* Keep the CodeMirror CSS editor within its column on narrow screens. */ | |
| 460 | +.wz-vertical-tabs .CodeMirror { | |
| 461 | + max-width: 100%; | |
| 462 | +} | |
| 463 | + | |
| 464 | +/* Horizontal tabs on small screens (WP admin breakpoint); pills keep their style. */ | |
| 465 | +@media screen and (max-width: 782px) { | |
| 466 | + #post-body.wz-settings-post-body { | |
| 467 | + display: block; | |
| 468 | + } | |
| 469 | + | |
| 470 | + .wz-vertical-tabs { | |
| 471 | + display: block; | |
| 472 | + } | |
| 473 | + | |
| 474 | + .wz-vertical-tabs > ul.nav-tab-wrapper { | |
| 475 | + flex-direction: row; | |
| 476 | + flex-wrap: wrap; | |
| 477 | + width: auto; | |
| 478 | + max-width: none; | |
| 479 | + position: static; | |
| 480 | + margin-bottom: 16px; | |
| 481 | + } | |
| 482 | + | |
| 483 | + .wz-vertical-tabs > ul.nav-tab-wrapper .wz-settings-search-wrap { | |
| 484 | + flex: 1 1 100%; | |
| 485 | + } | |
| 486 | +} | |
| 487 | + | |
| 488 | +/* Settings search. */ | |
| 489 | +.wz-vertical-tabs > ul.nav-tab-wrapper .wz-settings-search-wrap { | |
| 490 | + margin: 0 0 8px; | |
| 491 | + padding: 0; | |
| 492 | +} | |
| 493 | + | |
| 494 | +.wz-settings-search-box { | |
| 495 | + position: relative; | |
| 496 | + display: block; | |
| 497 | +} | |
| 498 | + | |
| 499 | +.wz-settings-search { | |
| 500 | + width: 100%; | |
| 501 | + margin: 0; | |
| 502 | + padding: 4px 28px 4px 8px; | |
| 503 | + border: 1px solid #8c8f94; | |
| 504 | + border-radius: 3px; | |
| 505 | + font-size: 13px; | |
| 506 | + line-height: 1.6; | |
| 507 | +} | |
| 508 | + | |
| 509 | +.wz-settings-search:focus { | |
| 510 | + border-color: #2271b1; | |
| 511 | + box-shadow: 0 0 0 1px #2271b1; | |
| 512 | + outline: none; | |
| 513 | +} | |
| 514 | + | |
| 515 | +/* Hide the native WebKit clear control; the plugin renders its own clear button. */ | |
| 516 | +.wz-settings-search::-webkit-search-cancel-button { | |
| 517 | + -webkit-appearance: none; | |
| 518 | + appearance: none; | |
| 519 | +} | |
| 520 | + | |
| 521 | +.wz-settings-search-clear { | |
| 522 | + position: absolute; | |
| 523 | + top: 50%; | |
| 524 | + right: 4px; | |
| 525 | + transform: translateY(-50%); | |
| 526 | + margin: 0; | |
| 527 | + padding: 0 6px; | |
| 528 | + border: 0; | |
| 529 | + border-radius: 2px; | |
| 530 | + background: transparent; | |
| 531 | + color: #646970; | |
| 532 | + cursor: pointer; | |
| 533 | + font-size: 18px; | |
| 534 | + line-height: 1.2; | |
| 535 | +} | |
| 536 | + | |
| 537 | +.wz-settings-search-clear:hover { | |
| 538 | + color: #d63638; | |
| 539 | +} | |
| 540 | + | |
| 541 | +.wz-settings-search-clear:focus-visible { | |
| 542 | + outline: 2px solid #2271b1; | |
| 543 | + outline-offset: 1px; | |
| 544 | +} | |
| 545 | + | |
| 546 | +.wz-settings-search-clear[hidden] { | |
| 547 | + display: none; | |
| 548 | +} | |
| 549 | + | |
| 550 | +/* Rows filtered out by the search. */ | |
| 551 | +.wz-search-hidden { | |
| 552 | + display: none !important; | |
| 553 | +} | |
| 554 | + | |
| 555 | +/* While searching, show every tab panel that has matches and hide the rest. */ | |
| 556 | +.wz-vertical-tabs.wz-searching > form > div { | |
| 557 | + display: none !important; | |
| 558 | +} | |
| 559 | + | |
| 560 | +.wz-vertical-tabs.wz-searching > form > div.wz-has-matches { | |
| 561 | + display: block !important; | |
| 562 | + margin-bottom: 24px; | |
| 563 | +} | |
| 564 | + | |
| 565 | +/* Hide the per-tab button rows and legends while searching; a single save bar is shown instead. */ | |
| 566 | +.wz-vertical-tabs.wz-searching > form > div.wz-has-matches > p { | |
| 567 | + display: none; | |
| 568 | +} | |
| 569 | + | |
| 570 | +.wz-vertical-tabs.wz-searching > form > div.wz-has-matches > table.form-table { | |
| 571 | + margin-top: 0; | |
| 572 | +} | |
| 573 | + | |
| 574 | +/* Per-tab section title: hidden normally, shown while searching to identify each group of results. */ | |
| 575 | +.wz-section-title { | |
| 576 | + display: none; | |
| 577 | +} | |
| 578 | + | |
| 579 | +.wz-vertical-tabs.wz-searching .wz-section-title { | |
| 580 | + display: block; | |
| 581 | + margin: 0; | |
| 582 | + padding: 6px 10px; | |
| 583 | + background: #f0f0f1; | |
| 584 | + border-left: 4px solid #2271b1; | |
| 585 | + color: #50575e; | |
| 586 | + font-size: 13px; | |
| 587 | + font-weight: 600; | |
| 588 | + text-transform: uppercase; | |
| 589 | + letter-spacing: 0.5px; | |
| 590 | +} | |
| 591 | + | |
| 592 | +/* Single sticky save bar shown while search results are displayed. */ | |
| 593 | +.wz-search-actions { | |
| 594 | + position: sticky; | |
| 595 | + bottom: 0; | |
| 596 | + margin: 0; | |
| 597 | + padding: 12px 0; | |
| 598 | + background: linear-gradient(to bottom, rgba(240, 240, 241, 0), #f0f0f1 40%); | |
| 599 | +} | |
| 600 | + | |
| 601 | +/* Match-count badge on the navigation tabs. */ | |
| 602 | +.wz-tab-count { | |
| 603 | + display: inline-block; | |
| 604 | + margin-left: 6px; | |
| 605 | + padding: 0 6px; | |
| 606 | + border-radius: 9px; | |
| 607 | + background-color: #2271b1; | |
| 608 | + color: #fff; | |
| 609 | + font-size: 11px; | |
| 610 | + line-height: 18px; | |
| 611 | + vertical-align: middle; | |
| 612 | +} | |
| 613 | + | |
| 614 | +.wz-vertical-tabs > ul.nav-tab-wrapper .nav-tab-active .wz-tab-count { | |
| 615 | + background-color: #fff; | |
| 616 | + color: #2271b1; | |
| 617 | +} | |
| 618 | + | |
| 619 | +.wz-vertical-tabs > ul.nav-tab-wrapper .wz-tab-no-matches { | |
| 620 | + opacity: 0.45; | |
| 621 | +} | |
| 622 | + | |
| 623 | +/* Highlighted search term in row labels. */ | |
| 624 | +mark.wz-search-mark { | |
| 625 | + padding: 0; | |
| 626 | + background-color: #fff3ad; | |
| 627 | + color: inherit; | |
| 628 | +} | |
| 629 | + | |
| 630 | +/* No results message. */ | |
| 631 | +.wz-search-no-results { | |
| 632 | + margin: 16px 0; | |
| 633 | + padding: 12px; | |
| 634 | + background: #fff; | |
| 635 | + border-left: 4px solid #dba617; | |
| 636 | + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04); | |
| 637 | +} | |
| 638 | + | |
| 639 | +/* Modified-from-default indicator. */ | |
| 640 | +.wz-modified-dot { | |
| 641 | + display: inline-block; | |
| 642 | + width: 8px; | |
| 643 | + height: 8px; | |
| 644 | + margin: 0 6px 0 2px; | |
| 645 | + border-radius: 50%; | |
| 646 | + background-color: #dba617; | |
| 647 | + vertical-align: middle; | |
| 648 | +} | |
| 649 | + | |
| 650 | +.wz-modified-legend { | |
| 651 | + margin-top: 4px; | |
| 652 | + color: #646970; | |
| 653 | + font-size: 12px; | |
| 654 | +} | |
| 655 | + | |
| 656 | +.wz-modified-legend .wz-modified-dot { | |
| 657 | + margin-left: 0; | |
| 658 | +} | |
| 659 | + | |
| 660 | +/* Hide the legend on tabs where nothing is modified. */ | |
| 661 | +form > div:not(:has(.form-table .wz-modified-dot)) .wz-modified-legend { | |
| 662 | + display: none; | |
| 663 | +} | |
| 664 | + | |
| 665 | +/* Default value note below field descriptions. */ | |
| 666 | +.wz-default-value { | |
| 667 | + color: #646970; | |
| 668 | + font-size: 12px; | |
| 669 | +} | |
| 670 | + | |
| 671 | +.wz-default-value code { | |
| 672 | + font-size: 11px; | |
| 673 | + padding: 1px 5px; | |
| 674 | + overflow-wrap: anywhere; | |
| 675 | + word-break: break-word; | |
| 676 | +} | |