Skip to content

Commit

Permalink
Components: Deprecate reduceMotion util (#60839)
Browse files Browse the repository at this point in the history
* Components: Deprecate `reduceMotion` util

* Add changelog

Co-authored-by: mirka <0mirka00@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: tyxla <tyxla@git.wordpress.org>
Co-authored-by: DaniGuardiola <daniguardiola@git.wordpress.org>
  • Loading branch information
5 people authored Apr 18, 2024
1 parent 4e9f1c3 commit b34daf3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

- Remove CSS hack for Internet Explorer 11 ([#60727](https://github.com/WordPress/gutenberg/pull/60727)).
- `CheckboxControl`: Streamline size styles ([#60475](https://github.com/WordPress/gutenberg/pull/60475)).
- Deprecate `reduceMotion` util ([#60839](https://github.com/WordPress/gutenberg/pull/60839)).
- `InputBase`: Simplify management of focus styles. Affects all components based on `InputControl` (e.g. `SearchControl`, `NumberControl`, `UnitControl`), as well as `SelectControl`, `CustomSelectControl`, and `TreeSelect` ([#60226](https://github.com/WordPress/gutenberg/pull/60226)).

## 27.3.0 (2024-04-03)
Expand Down
4 changes: 4 additions & 0 deletions packages/components/src/utils/reduce-motion.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
*
* @param {'transition' | 'animation' | string} [prop='transition'] CSS Property name
* @return {string} Generated CSS code for the reduced style
*
* @deprecated Write your own media query instead,
* e.g. `@media not ( prefers-reduced-motion ) { ...some animation... }` or
* `@media ( prefers-reduced-motion ) { ...reduced animation... }`.
*/
export function reduceMotion( prop = 'transition' ) {
let style;
Expand Down

1 comment on commit b34daf3

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in b34daf3.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/8742235380
📝 Reported issues:

Please sign in to comment.