scroll-scrubbed-word-reveal
Installation
SKILL.md
Scroll-Scrubbed Word Reveal
Make reading progress visible without replacing real text, breaking inline markup, or depending on a fixed line count.
Prepare the text
- Keep one untouched accessible text source in the DOM.
- Walk text nodes with
TreeWalker; do not flatten the container withtextContentorinnerHTML. - Skip
script,style, form controls, and elements marked with[data-no-split]. - Replace only non-whitespace tokens with spans and preserve whitespace nodes exactly.
- Mark generated spans
aria-hidden="true"only when an equivalent unsplit accessible copy remains available.
Preferred structure:
<p class="reveal" data-reveal>
Motion should <em>explain</em> the next state, not decorate it.
</p>