Repository navigation
FSHSP-252 feat(motion): motion tokens in three layers, recipes read by the kit, reduced motion by mode - #181
Merged
Merged
Conversation
…e recipes in the kit
3 of 7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Jira: FSHSP-252. React parity: FSHSP-253. Figma variables: FSHSP-254.
Motion becomes a token, like colour:
--transition-*stay the primitives (no rename, nothing deprecated), a newmotioncollection holds recipes by usage that alias them, and the kit reads the recipes. Timing is unchanged outside reduced motion.scripts/tokens.build.mjs): DTCGduration("80ms",{ value, unit }),cubicBezier([x1, y1, x2, y2]→cubic-bezier()) anddimensionobjects get their CSS form; a unitless duration or a curve whose x leaves [0, 1] fails the build. Numbers are rounded to 6 significant digits (Figma stores 0.96 as 0.9599999785423279). A mode mapped tonullintokens.config.jsonis not emitted.transition/*retypedSTRING→TIMING/EASINGunder the same names; curves now readcubic-bezier(0.42, 0, 0.58, 1)instead ofease-in-out(same curve). Newmotion.json:hover,toggle,overlay/in|out,disclosure/*,dialog/*,notify/*,stagger,slide,zoom, modesStandard/Reduced._ui-config.scss,utils,base/_motion.scss):control-transitiontakestogglefor properties that move (transform,top,width…) andhoverfor the rest;motion-transitionreadstoggle; presets readoverlay-in/overlay-out; speed-dial readsstagger. Each recipe falls back to the primitive the kit used before, so overrides of--transition-*and--ui-control-transition-*still apply. No mixin signature changes (copy mode safe).Reducedmode is emitted under(prefers-reduced-motion: reduce)and replaces the presets'0.01ms !important: slides and zooms become 80ms fades, movement shortens, colour changes keep their duration.data-motion="off"unchanged.pnpm motion:check(indocs:config:check) rejects hand-written durations, curves orvar(--transition-*)in component SCSS; 3 justified exceptions (skeleton, spinner, progress-bar loops, waiting for alooprecipe).Checks: kit tests (27 files), script tests (17), schematics (99), lint,
docs:config:check. Verified in static Storybook with Playwright: toggle thumb and colours at 0.18s at rest;--motion-hover-durationonly moves colours,--motion-toggle-durationonly the thumb; reduced motion turns presets into 80ms fades;data-motion="off"still cuts everything.Token Flow must stay in
linkedmode: inresolvermode it rewritesscripts/tokens.build.mjs.