diff --git a/buttons.css b/buttons.css new file mode 100644 index 0000000..eb4d605 --- /dev/null +++ b/buttons.css @@ -0,0 +1,54 @@ +/* Button motion: one shared, very small hover and press language for every page. + Each page keeps its own hover colours; this file only adds the easing and the press-down. */ +button, +.btn, +.link-button, +select.btn-outline { + transition: background-color 120ms ease-out, border-color 120ms ease-out, color 120ms ease-out, + filter 120ms ease-out, box-shadow 120ms ease-out, transform 120ms ease-out; +} + +/* Press down: a 3% shrink that springs back. Disabled controls never move. */ +button:not(:disabled):active, +a.btn:active, +.btn:not(:disabled):not(select):active { + transform: scale(0.97); + transition-duration: 60ms; +} + +/* Small, dense controls shrink a little less so they do not look jumpy. */ +table button:not(:disabled):active, +.sx-row button:not(:disabled):active, +.sx-pick button:not(:disabled):active, +.role-seg button:not(:disabled):active, +.theme-toggle button:not(:disabled):active, +.theme button:not(:disabled):active, +.link-button:not(:disabled):active { + transform: scale(0.98); +} + +button:disabled { + transition: none; +} + +/* Reduced motion: keep the colour easing, drop the press-down. */ +@media (prefers-reduced-motion: reduce) { + button, + .btn, + .link-button, + select.btn-outline { + transition: background-color 120ms ease-out, border-color 120ms ease-out, color 120ms ease-out; + } + button:not(:disabled):active, + a.btn:active, + .btn:not(:disabled):not(select):active, + table button:not(:disabled):active, + .sx-row button:not(:disabled):active, + .sx-pick button:not(:disabled):active, + .role-seg button:not(:disabled):active, + .theme-toggle button:not(:disabled):active, + .theme button:not(:disabled):active, + .link-button:not(:disabled):active { + transform: none; + } +}