Diffdown is a real-time collaborative Markdown editor/previewer built on the AT Protocol diffdown.com

Fix para highlight: use Web Animations API instead of CSS @keyframes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

+5 -14
-9
static/css/editor.css
··· 279 279 border-color: var(--primary); 280 280 } 281 281 282 - @keyframes para-highlight { 283 - 0% { box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.7), 0 0 0 4px rgba(37, 99, 235, 0.15); } 284 - 100% { box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0), 0 0 0 4px rgba(37, 99, 235, 0); } 285 - } 286 - 287 - .para-highlight { 288 - animation: para-highlight 1.4s ease-out forwards; 289 - border-radius: 3px; 290 - } 291 282 292 283 .comment-thread-label { 293 284 font-size: 0.75rem;
+5 -5
templates/document_edit.html
··· 891 891 const target = blocks[idx]; 892 892 if (!target) return; 893 893 target.scrollIntoView({ behavior: 'smooth', block: 'center' }); 894 - target.classList.remove('para-highlight'); 895 - // Force reflow so the animation restarts if clicked twice. 896 - void target.offsetWidth; 897 - target.classList.add('para-highlight'); 898 - target.addEventListener('animationend', () => target.classList.remove('para-highlight'), { once: true }); 894 + target.animate( 895 + [{ outline: '3px solid rgba(37,99,235,0.8)', outlineOffset: '2px' }, 896 + { outline: '3px solid rgba(37,99,235,0)', outlineOffset: '2px' }], 897 + { duration: 1400, easing: 'ease-out' } 898 + ); 899 899 } 900 900 901 901 function setupParagraphCommentTrigger() {