Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Issues
  • #29862
Closed
Open
Issue created Dec 16, 2019 by Administrator@rootContributor

prefers-reduce-motion globally instead of duplicating it?

Created by: ffoodd

Af of v4.4.1 — and since #25249 (closed) — the transition() mixins unsets transition when user prefers-reduced-motion (which is great).

However there are at least two caveats with this way of unsetting transitions:

  1. the whole media query is duplicated a lot (each time the mixin is used, 16 times in 4.4.1)
  2. it's only done for this specific mixin, however there a few components using animations or transitions without using this mixin (progress bar, for example).

What would you think about reducing motion globally and drastically?

My main resource for this is Andy Bell's "Modern CSS reset" but there're a lot more resources out there.

Coupling with $enable-prefers-reduced-motion-media-query, it might look like this:

@if $enable-prefers-reduced-motion-media-query {
  @media (prefers-reduced-motion: reduce) {
    * {
      transition-duration: .01ms !important;
      animation-duration: .01ms !important;
      animation-iteration-count: 1 !important;
    }
  }
}

And it should be shorter and more efficient than 16 times of scoped transition: none. I guess it could be either in _transitions.scss or in _reboot.scss; both of them would make sense to me.

I don't know if / on which version it could be done, but I'd be pleased to make a PR if it does interest you.

Assignee
Assign to
Time tracking