Add hide-sm and wrap helpers; limit hover styles to pointer devices
This commit is contained in:
1 parent
be6e463627
commit
1b1a8ee914
1 file changed
+13
-3
+13
-3
@@ -149,6 +149,11 @@ legend { padding: 0; }
|
||||
clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
|
||||
}
|
||||
|
||||
/* Phones: drop a button's text label to save room, but keep it for screen readers. */
|
||||
@media (max-width: 420px) {
|
||||
.hide-sm { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
|
||||
}
|
||||
|
||||
/* ---------- Layout helpers ---------- */
|
||||
.stack { display: flex; flex-direction: column; gap: var(--s3); }
|
||||
.stack-lg { display: flex; flex-direction: column; gap: var(--s5); }
|
||||
@@ -191,20 +196,25 @@ button, .btn {
|
||||
transform var(--dur-out) var(--ease), box-shadow var(--dur) var(--ease);
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
}
|
||||
button:hover:not(:disabled), .btn:hover { background: var(--surface-2); }
|
||||
/* Hover only where a pointer hovers; on phones it would stick after a tap. */
|
||||
@media (hover: hover) {
|
||||
button:hover:not(:disabled), .btn:hover { background: var(--surface-2); }
|
||||
button.primary:hover:not(:disabled), .btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
|
||||
button.ghost:hover:not(:disabled), .btn.ghost:hover { background: var(--surface-2); }
|
||||
}
|
||||
button:active:not(:disabled), .btn:active { transform: scale(0.97); }
|
||||
button:disabled { opacity: 0.45; cursor: not-allowed; }
|
||||
button.primary, .btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-1); }
|
||||
button.primary:hover:not(:disabled), .btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
|
||||
button.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
|
||||
button.danger.solid { background: var(--danger); color: var(--surface); border-color: var(--danger); }
|
||||
button.ghost, .btn.ghost { background: transparent; border-color: transparent; }
|
||||
button.ghost:hover:not(:disabled), .btn.ghost:hover { background: var(--surface-2); }
|
||||
/* .sm is visually compact but keeps the full 44px tap target */
|
||||
button.sm, .btn.sm { min-height: 44px; padding: 0 var(--s3); font-size: var(--fs-sm); border-radius: var(--r-sm); }
|
||||
button.lg, .btn.lg { min-height: 56px; padding: 0 var(--s5); font-size: var(--fs-md); border-radius: var(--r-lg); }
|
||||
button.block, .btn.block { width: 100%; }
|
||||
button.icon { padding: 0; width: 44px; }
|
||||
/* Labels that can be long (user-named calendars, time zones) wrap instead of overflowing the screen. */
|
||||
button.wrap, .btn.wrap { white-space: normal; text-align: center; padding-block: var(--s2); }
|
||||
button[aria-pressed='true'] { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-text); }
|
||||
|
||||
/* ---------- Forms ---------- */
|
||||
|
||||
Reference in new issue
Block a user