MCPcopy
hub / github.com/romboHQ/tailwindcss-motion / addBaseAnimations

Function addBaseAnimations

src/baseAnimations.ts:95–495  ·  view source on GitHub ↗
(
  matchUtilities: PluginAPI["matchUtilities"],
  theme: (path: keyof ThemeConfig) => Record<string, string>
)

Source from the content-addressed store, hash-verified

93 `motion-text-color-loop-${type} calc(var(--motion-text-color-duration, --motion-duration) * var(--motion-text-color-perceptual-duration-multiplier, --motion-perceptual-duration-multiplier)) var(--motion-text-color-timing, --motion-timing) var(--motion-text-color-delay, --motion-delay) both var(--motion-text-color-loop-count, --motion-loop-count)`;
94
95export function addBaseAnimations(
96 matchUtilities: PluginAPI["matchUtilities"],
97 theme: (path: keyof ThemeConfig) => Record<string, string>
98) {
99 // scale
100 matchUtilities(
101 {
102 "motion-scale-in": (value) => ({
103 "--motion-origin-scale-x": value,
104 "--motion-origin-scale-y": value,
105 "--motion-scale-in-animation": scaleInAnimation,
106 animation: allLoopAndEnterAnimations,
107 }),
108 "motion-scale-x-in": (value) => ({
109 "--motion-origin-scale-x": value,
110 "--motion-scale-in-animation": scaleInAnimation,
111 animation: allLoopAndEnterAnimations,
112 }),
113 "motion-scale-y-in": (value) => ({
114 "--motion-origin-scale-y": value,
115 "--motion-scale-in-animation": scaleInAnimation,
116 animation: allLoopAndEnterAnimations,
117 }),
118
119 "motion-scale-out": (value) => ({
120 "--motion-end-scale-x": value,
121 "--motion-end-scale-y": value,
122 "--motion-scale-out-animation": scaleOutAnimation,
123 animation: allExitAnimations,
124 }),
125 "motion-scale-x-out": (value) => ({
126 "--motion-end-scale-x": value,
127 "--motion-scale-out-animation": scaleOutAnimation,
128 animation: allExitAnimations,
129 }),
130 "motion-scale-y-out": (value) => ({
131 "--motion-end-scale-y": value,
132 "--motion-scale-out-animation": scaleOutAnimation,
133 animation: allExitAnimations,
134 }),
135 },
136 {
137 values: theme("motionScale"),
138 }
139 );
140
141 // scale loop
142 matchUtilities(
143 {
144 "motion-scale-x-loop": (value, { modifier }) => ({
145 "--motion-loop-scale-x": value,
146 "--motion-scale-loop-animation": scaleLoopAnimation(
147 modifier || "mirror"
148 ),
149 animationComposition: "accumulate",
150 animation: allLoopAndEnterAnimations,
151 }),
152 "motion-scale-y-loop": (value, { modifier }) => ({

Callers 1

pluginCreatorFunction · 0.85

Calls 7

scaleLoopAnimationFunction · 0.85
translateLoopAnimationFunction · 0.85
rotateLoopAnimationFunction · 0.85
filterLoopAnimationFunction · 0.85
opacityLoopAnimationFunction · 0.85
textColorLoopAnimationFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…