Thanks for taking an interest. This is a small, deliberately low-dependency project, so contributing should be quick to get started with.
git clone https://github.com/css-scroll-driven/scroll-anim-fallback.git
cd scroll-anim-fallback
npm install
npm testpostcss is the only dependency in the entire tree. There is no bundler, no
transpiler, and no test framework — tests run on Node's built-in
node --test runner.
Keep the dependency count at one. If a change needs a new runtime or build
dependency, open an issue first and explain why hand-writing it is worse. The
UMD bundle is produced by packages/scroll-anim-fallback-runtime/build.mjs,
about eighty lines of string handling, and that is on purpose.
Every change to a parser or to the range math needs a test. Both are pure functions, so tests are a couple of lines. Range-math changes should cite the spec behaviour they implement in the test name or a comment.
Keep DOM code out of range-math.js. The value of that module is that it is
testable in Node. Measurement belongs in src/dom.js, wiring in src/index.js.
The runtime must stay free in supported browsers. Any change that makes
init() allocate, query the DOM, or attach a listener before the
CSS.supports() check will be rejected.
- Node ESM everywhere; no CommonJS.
- JSDoc type annotations on every exported function, including
@param,@returnsand a one-line description. - Two-space indentation, semicolons, single quotes.
- No dead code, no commented-out blocks, no
TODOmarkers left behind. - Comments explain why, not what.
npm test # everything
node --test packages/postcss-scroll-anim-fallback/test/
node --test packages/scroll-anim-fallback-runtime/test/npm test runs the runtime build first, because the bundle test evaluates the
generated file.
- Branch from
master. - Make the change, add tests, run
npm test. - If you touched the plugin's output or the manifest shape, run
npm run examplesand check the demos still behave. - If you changed anything users see — options, manifest fields, API — update
README.mdand add aCHANGELOG.mdentry under anUnreleasedheading. - Keep the PR focused. One behaviour change per PR is much easier to review.
A fallback that looks wrong is usually a range-math or mode-selection issue. The most useful report includes:
- the source CSS rule,
- the manifest entry the plugin produced for it,
- the browser and whether it has native
animation-timelinesupport, - what you expected to see and what you saw.
If it is a progress-fidelity issue, logging --saf-progress alongside the
native animation's currentTime in a supporting browser makes the discrepancy
obvious very quickly.