/* -------------------------------------------------------------------------- Buttons -------------------------------------------------------------------------- */ .wpsubs-btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 36px; padding: 0 14px; border-radius: var(--wpsubs-radius-sm); font-size: 13px; font-weight: 500; font-family: inherit; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background 0.12s, border-color 0.12s, color 0.12s; border: 1px solid transparent; line-height: 1; vertical-align: middle; box-shadow: none; } .wpsubs-btn:focus, .wpsubs-btn:focus-visible, .wpsubs-btn:active { outline: none !important; box-shadow: none !important; border-radius: var(--wpsubs-radius-sm) !important; } .wpsubs-btn--outline { background: var(--wpsubs-surface); border-color: var(--wpsubs-border); color: var(--wpsubs-text); } .wpsubs-btn--outline:hover { border-color: var(--wpsubs-border-strong); background: var(--wpsubs-surface-muted); color: var(--wpsubs-text); text-decoration: none; } .wpsubs-btn--primary { background: var(--wpsubs-brand); border-color: var(--wpsubs-brand); color: #fff; } .wpsubs-btn--primary:hover { background: var(--wpsubs-brand-dark); border-color: var(--wpsubs-brand-dark); color: #fff; text-decoration: none; } /* Icon-only square button */ .wpsubs-btn--icon { width: 36px; height: 36px; padding: 0; flex-shrink: 0; } /* Subtle, borderless icon action (row/card controls). */ .wpsubs-icon-action { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; border: none; border-radius: var(--wpsubs-radius-sm); background: transparent; color: var(--wpsubs-text-subtle); cursor: pointer; transition: background 0.12s, color 0.12s; } .wpsubs-icon-action:hover { background: var(--wpsubs-surface-muted); color: var(--wpsubs-text); } .wpsubs-icon-action--danger:hover { background: #fef2f2; color: #dc2626; } .wpsubs-icon-action .dashicons { font-size: 17px; width: 17px; height: 17px; line-height: 1; } .wpsubs-btn--sm { height: 30px; padding: 0 10px; font-size: 12px; } /* Muted: a secondary action that should not compete with the row's content. Outline's shape, with the label dropped back to the muted text tone. */ .wpsubs-btn--muted { background: var(--wpsubs-surface); border-color: var(--wpsubs-border); color: var(--wpsubs-text-muted); } .wpsubs-btn--muted:hover { border-color: var(--wpsubs-border-strong); background: var(--wpsubs-surface-muted); color: var(--wpsubs-text); text-decoration: none; } .wpsubs-btn--muted .dashicons { font-size: 15px; width: 15px; height: 15px; line-height: 1; } .wpsubs-btn--danger { background: var(--wpsubs-surface); border-color: #fca5a5; color: #dc2626; } .wpsubs-btn--danger:hover { background: #fef2f2; border-color: #f87171; color: #b91c1c; text-decoration: none; } /* -------------------------------------------------------------------------- Disabled + in-flight states setLoading() (plans.js / plan-forms.js) sets `disabled` and toggles `is-loading` on the submit button — and on the controls beside it — for as long as a REST write is in flight. Without these rules the class is inert, so a slow save is indistinguishable from a dead button. -------------------------------------------------------------------------- */ .wpsubs-btn:disabled, .wpsubs-icon-action:disabled { opacity: 0.6; cursor: not-allowed; pointer-events: none; } /* The label is hidden rather than removed so the button keeps its width. */ .wpsubs-btn.is-loading { position: relative; color: transparent !important; } /* The spinner replaces the label, so the button still reads as itself. */ .wpsubs-btn.is-loading::after { content: ""; position: absolute; top: 50%; left: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border: 2px solid var(--wpsubs-border-strong); border-top-color: var(--wpsubs-text); border-radius: 50%; animation: wpsubs-btn-spin 0.6s linear infinite; } /* `color` is transparent while loading, so the ring needs its own colours. */ .wpsubs-btn--primary.is-loading::after { border-color: rgba(255, 255, 255, 0.45); border-top-color: #ffffff; } .wpsubs-btn--danger.is-loading::after { border-color: #fca5a5; border-top-color: #dc2626; } /* A spinning button is already unmistakably busy — dimming it hides the ring. */ .wpsubs-btn.is-loading:disabled { opacity: 1; } @keyframes wpsubs-btn-spin { to { transform: rotate(360deg); } } @media (prefers-reduced-motion: reduce) { .wpsubs-btn.is-loading::after { animation-duration: 2s; } }