Skip to content

Commit

Permalink
fix: no down state for reduced motion
Browse files Browse the repository at this point in the history
  • Loading branch information
mdt2 committed Feb 29, 2024
1 parent 42629dc commit ba2e79f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 6 additions & 2 deletions components/button/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -150,19 +150,23 @@ governing permissions and limitations under the License.
&:active {
/* stylelint-disable-next-line spectrum-tools/no-unknown-custom-properties */
transform: perspective(max(var(--spectrum-downstate-height), var(--spectrum-downstate-width) * var(--spectrum-component-size-width-ratio-down))) translateZ(var(--spectrum-component-size-difference-down));

@media (prefers-reduced-motion: reduce) {
transform: none;
}
}

.spectrum-Icon {
/* Any block-size difference between the intended workflow icon size and actual icon used.
Helps support any existing use of smaller UI icons instead of intended Workflow icons. */
--_icon-size-difference: max(0px,
var(--spectrum-button-intended-icon-size) -
var(--spectrum-button-intended-icon-size) -
var(--spectrum-icon-block-size, var(--spectrum-button-intended-icon-size))
);

margin-block-start: var(--mod-button-icon-margin-block-start,
max(0px,
var(--mod-button-top-to-icon, var(--spectrum-button-top-to-icon)) -
var(--mod-button-top-to-icon, var(--spectrum-button-top-to-icon)) -
var(--mod-button-border-width, var(--spectrum-button-border-width)) +
(var(--_icon-size-difference, 0px) / 2)
)
Expand Down
4 changes: 4 additions & 0 deletions components/checkbox/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ governing permissions and limitations under the License.
&:active {
.spectrum-Checkbox-box {
transform: perspective(var(--spectrum-component-size-minimum-perspective-down)) translateZ(var(--spectrum-component-size-difference-down));

@media (prefers-reduced-motion: reduce) {
transform: none;
}
}

.spectrum-Checkbox-box::before {
Expand Down

0 comments on commit ba2e79f

Please sign in to comment.