Existence file

css-media-pseudo-polyfill

A progressive polyfill for media state pseudo-classes such as :playing, :paused, :seeking, :buffering, :stalled, and :muted. It exists so authors can write state-driven media styles now while browsers continue filling support gaps.

Goal

Detect unsupported media pseudo-classes, preserve authored cascade intent by rewriting CSS into specificity-equivalent class selectors, and update audio and video elements as their playback state changes.

  • TypeScript
  • CSS
  • Polyfill

Now

Where it is

The package supports per-pseudo-class feature detection, inline and same-origin linked stylesheet rewriting, MutationObserver-based media discovery, pure state computation, and explicit handling for non-polyfillable :volume-locked.

Next

What comes next

  • Add GOAL.md and ROADMAP.md so the polyfill scope and future removal path are captured outside the README.
  • Keep tests focused on CSS rewriting, state computation, same-origin stylesheet behavior, and dynamic media elements.
  • Document browser support and FOUC tradeoffs as native media pseudo-class support changes.