Skip to content

fix(webkit): animate code-block line entrance on the translate property - #1027

Open
gabriel-lisboa-azion wants to merge 1 commit into
mainfrom
fix/code-block-line-entrance
Open

gabriel-lisboa-azion wants to merge 1 commit into
mainfrom
fix/code-block-line-entrance

Conversation

@gabriel-lisboa-azion

Copy link
Copy Markdown
Contributor

Summary

  • CodeBlock's line entrance (animateLines) and tab-swap line motion transition translate instead of transform: under Tailwind v4 -translate-x-2/translate-x-0 set the standalone translate property, so the slide never interpolated and lines only faded.
  • The animateLines stagger drops from 300ms to 40ms per line.
  • Spec, story argType and catalog say 40ms; a browser test guards the transition property.

How to test

  1. cd packages/webkit && npx vitest run src/components/data/code-block/code-block.test.ts → 39 tests pass, including "line entrance".
  2. Render <CodeBlock :animate-lines="true"> with a multi-line snippet and reload → each line slides in from the left while fading, 40ms after the previous one.
  3. Switch tabs on a multi-tab CodeBlock → lines slide in from the direction of travel.
  4. Enable reduced motion and reload → lines appear immediately.

Notes

  • Visible behaviour change: animateLines blocks enter 7.5× faster. No API change.
  • This PR and the hcl/graphql highlighting PR both touch .specs/code-block.md; whichever merges second rebases and recomputes the spec checksum.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant