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