Skip to content

Commit

Permalink
BLUE-7 prefers-reduced-motion
Browse files Browse the repository at this point in the history
  • Loading branch information
lgk-bsw committed Oct 14, 2024
1 parent 0150689 commit 0f2ef17
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion dist/style.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Blue React v9.12.0 (https://bruegmann.github.io/blue-react)
* Blue React v9.12.1 (https://bruegmann.github.io/blue-react)
* Licensed under GNU General Public License v3.0 (https://github.com/bruegmann/blue-react/blob/master/LICENSE).
*/

Expand Down
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "blue-react",
"version": "9.12.0",
"version": "9.12.1",
"description": "Blue React Components",
"license": "LGPL-3.0-or-later",
"main": "index.js",
Expand Down Expand Up @@ -32,7 +32,7 @@
},
"dependencies": {
"@popperjs/core": "^2.11.5",
"blue-web": "^1.2.0",
"blue-web": "^1.3.2",
"bootstrap": "~5.3.3",
"clsx": "^1.1.1"
},
Expand Down
4 changes: 3 additions & 1 deletion src/components/Chevron.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ export interface ChevronProps {
* Chevron icon component with open state.
*/
export default function Chevron({ open, mirrored, className, style }: ChevronProps) {
const prefersReducedMotion = window.matchMedia("(prefers-reduced-motion)").matches

return (
<svg
xmlns="http://www.w3.org/2000/svg"
Expand All @@ -31,7 +33,7 @@ export default function Chevron({ open, mirrored, className, style }: ChevronPro
display: "inline-block",
verticalAlign: "-0.125em",
transform: `rotate(${open && mirrored ? -90 : open ? 90 : 0}deg)`,
transition: "transform 0.2s"
transition: prefersReducedMotion ? "none" : "transform 0.2s"
}}
viewBox="0 0 16 16"
>
Expand Down
Loading

0 comments on commit 0f2ef17

Please sign in to comment.