# Reduced motion

Source: https://material.spynejs.com/features/reduced-motion
Part of: Material shell gallery, Google's Material Design 3 for SpyneJS. Index: https://material.spynejs.com/llms.txt

What the template does when a visitor's system asks for less motion. Material's answer is subtle fades in place of sliding and scaling, not no motion at all. Every moving thing in the template has both ways. A model does not ask for it.

## In an app model

Nothing. It is the visitor’s setting, and every app on the template follows it.

## In a style

Anything of your own that slides, grows or shrinks needs a second rule, for a visitor who asks for less. Keep a fade; drop the rest:

```css
.my-panel {
  transition:
    opacity var(--md-sys-motion-duration-short4)
      var(--md-sys-motion-easing-standard-decelerate),
    transform var(--md-sys-motion-duration-short4)
      var(--md-sys-motion-easing-standard-decelerate);
}

@media (prefers-reduced-motion: reduce) {
  .my-panel {
    transition: opacity var(--md-sys-motion-duration-short4)
      var(--md-sys-motion-easing-standard-decelerate);
  }
}
```

- A thing that only fades is already the reduced way and needs no second rule.
- Do not cut from one thing to another with nothing between: Material asks for a fade there.
- It is styles alone. No script reads the setting.

## Where it is in the template

| File | What it holds | By name |
| --- | --- | --- |
| `src/scss/03-components/material/_motion.scss` | the moves between pages, each with its reduced way |  |
| `src/scss/03-components/material/_ripple.scss` | the ripple, and what shows in its place |  |
| `src/scss/03-components/material/_snackbar.scss` | the snackbar arriving |  |
| `src/scss/03-components/ui/menu-drawer.scss` | the drawer opening |  |

The template is public: https://github.com/spynejs/application-shell-material. An app made from it has these same files.

## As the page shows it

The page’s own words, in its own order, read from the page as it is drawn in the light colour scheme. They were written for someone looking at the page: “above”, “below” and “marked” mean the drawn page. A thing the page draws is named here in its place (`Button:`, `Field:`, `Switch:`), and a box that reports what the reader does is as it starts, empty. What depends on the reader’s own window is left out.

A visitor can ask their system for less motion. Material’s answer is subtle fades in place of sliding and scaling, not no motion at all. Below is each thing in the template that moves, and what it does either way. The way that applies to you now is the one in full strength.

| What moves | With motion | With reduced motion |
| --- | --- | --- |
| A move down or up a level | The leaving page slides out to one side as it fades, and the next slides in from the other. | Neither page slides. One fades out, then the next fades in. |
| A move down a level by a card | The card’s shape grows into its page. Back up, the page shrinks into its card. | No shape moves. One screen fades into the next. |
| A move between destinations | The page fades out, then the next fades in. | The same. |
| A press | A ripple grows from the pressed point. | No ripple. The pressed layer shows flat, at once. |
| A button’s focus ring | It grows wide, then settles. | It shows at its settled width at once. |
| The drawer opening | The panel slides in from the side. | The panel stays in place and fades in. |
| A snackbar arriving | It expands upward from its bottom edge. | It fades in. |
| The app bar, as the page scrolls | Its colour and shadow change over a quarter of a second. | They change at once. |

To try it, turn on reduced motion in your system’s accessibility settings, or have the browser’s developer tools emulate it. This page changes as soon as you do. The markers on the Motion page are the gallery’s own and move either way.

Nothing to ask for in a model. It is the visitor’s setting, and every app on the template follows it.
