Skip to content

Commit a82eb36

Browse files
authored
docs: Motion tokens page supports windows high contrast (#33915)
1 parent 365204e commit a82eb36

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed

packages/react-components/react-motion/stories/src/Tokens/Cards.styles.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ export const useCardClasses = makeStyles({
5757
animationDuration: '2s',
5858
animationIterationCount: 'infinite',
5959
animationFillMode: 'forwards',
60+
61+
'@media (forced-colors: active)': {
62+
backgroundColor: 'LinkText',
63+
},
6064
},
6165

6266
graph: {
@@ -67,6 +71,10 @@ export const useCardClasses = makeStyles({
6771
". graphT" / min-content 1fr
6872
`,
6973
gap: '6px',
74+
75+
'@media (forced-colors: active)': {
76+
backgroundColor: 'Canvas',
77+
},
7078
},
7179
graphP: {
7280
gridArea: 'graphP',
@@ -89,6 +97,15 @@ export const useCardClasses = makeStyles({
8997
height: 'var(--container-size)',
9098
width: 'var(--container-size)',
9199
},
100+
path: {
101+
fill: 'none',
102+
stroke: tokens.colorNeutralStrokeAccessible,
103+
strokeWidth: '2',
104+
105+
'@media (forced-colors: active)': {
106+
stroke: 'CanvasText',
107+
},
108+
},
92109

93110
duration: {
94111
placeSelf: 'center',
@@ -103,6 +120,10 @@ export const useCardClasses = makeStyles({
103120
to: { transform: 'rotate(180deg)' },
104121
},
105122
animationIterationCount: 'infinite',
123+
124+
'@media (forced-colors: active)': {
125+
backgroundColor: 'CanvasText',
126+
},
106127
},
107128

108129
view: {

packages/react-components/react-motion/stories/src/Tokens/Cards.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Divider, tokens, Switch } from '@fluentui/react-components';
1+
import { Divider, Switch } from '@fluentui/react-components';
22
import { curves, durations } from '@fluentui/react-motion';
33
import * as React from 'react';
44

@@ -32,9 +32,7 @@ const MotionCurveCard: React.FC<{ animationEnabled: boolean; tokenName: string;
3232
d={`M 0 100 C ${easingPoints[0]} ${100 - easingPoints[1]}, ${easingPoints[2]} ${
3333
100 - easingPoints[3]
3434
}, 100 0`}
35-
fill="none"
36-
stroke={tokens.colorNeutralStrokeAccessible}
37-
strokeWidth="2"
35+
className={classes.path}
3836
/>
3937
</svg>
4038

0 commit comments

Comments
 (0)