feat(css): CSS-only scroll reveal system - #5
Open
corneliusio wants to merge 2 commits into
Open
Conversation
Replace JS data-animate usage with a zero-JS reveal system built on scroll-driven animations and container style queries: - enter: variant hides any utility's declarations until the element's parent enters the viewport; sensing is ambient, so no trigger class exists and grids fire row by row automatically - presets (fade, slide-*, zoom), stagger utilities including live column-count cycling backed by grid-fill math, and composition with core duration/ease/delay through their published vars - scroll-latch opts a group into one-shot reveals; replay on re-entry is the default, consistent in every browser - tiers via @supports: reduced-motion and print get static content, Firefox gets a load-time fade, scroll-driven-animation browsers get scroll-triggered reveals Templates migrate from data-animate to enter:* classes; the home template carries hard-coded demo patterns for every mechanism.
Greptile SummaryThe PR replaces JavaScript-oriented animation markup with a CSS-only scroll-reveal system and migrates shared content templates to the new utilities.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains; the previously reported third-party homepage image has been removed from the current rendering path. Important Files Changed
|
Contributor
Author
|
@greptileai review |
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.
Summary
Replaces the JS
data-animatereveal system with a zero-JavaScript equivalent built on scroll-driven animations and container style queries. Any element can now declare its hidden state withenter:*utilities (any property, or thefade/slide-*/zoompresets) and transitions to its real styles when its parent enters the viewport.How it works
enter:*content a sensor (view()timeline flips an--in-viewflag consumed by a container style query). Grids fire row by row automatically; sections fire off their innermost wrapper.scroll-latch= opt-in one-shot. A latch absorbs its parent's trigger duty and freezes its subtree's reveal state after the first run. Replay on re-entry is the default, consistently in every browser (nativeanimation-trigger: play-onceis deliberately not used to avoid Chrome-only divergence).stagger, explicitstagger-N, cycledstagger-n-N, andstagger-fill, which cycles by the live column count of agrid-fill-*grid (computed in CSS from container units;tan(atan2())division for Firefox compatibility).duration-*,ease-*,delay-*) via their published variables;delay-*andgap-*get small shims to expose vars core doesn't.@supports: reduced-motion/print get static visible content; Firefox (no scroll-driven animations) gets a staggered load-time fade; Chrome and Safari 26 get full scroll-triggered reveals. Content is never left hidden on any tier, including print.Migration
All templates using
data-animatenow useenter:*classes (fade-only, matching the old defaults). The now-deaddata-animateJS module, itsinit.tsregistration, and the[data-animate]base rule are left in place for a follow-up cleanup.Verification
Behavior verified in Chromium (scroll-driven tier: hidden states, per-row firing, latch one-shot, replay, print/reduced-motion gating) and headless Firefox 154 (load-fade tier,
sibling-index()stagger math, live column-count cycling at multiple widths). Known limitation: Firefox reveals are a generic fade because Gecko style queries ignore animation-driven custom properties.