diff options
| author | Claude <noreply@anthropic.com> | 2026-02-18 21:52:21 +0000 |
|---|---|---|
| committer | Claude <noreply@anthropic.com> | 2026-02-18 21:52:21 +0000 |
| commit | 1362f00d39e90aef8a8338887222541a5a992178 (patch) | |
| tree | 11a98c935af0b3da96580425c2ca71ea5686e356 /frontend-vanilla/public/themes/terminal.css | |
| parent | 7776e81b39130c211eb0ec566c6467a28a9fa64c (diff) | |
| download | neko-1362f00d39e90aef8a8338887222541a5a992178.tar.gz neko-1362f00d39e90aef8a8338887222541a5a992178.tar.bz2 neko-1362f00d39e90aef8a8338887222541a5a992178.zip | |
Fix theme performance regressions affecting mobile scroll
The new theme CSS files introduced several patterns that cause
scroll jank and memory pressure, especially on mobile:
- terminal.css: Full-viewport fixed pseudo-element with repeating
gradient scanlines forced GPU compositing on every scroll frame.
Now limited to desktop only with will-change layer promotion.
- codex.css/sakura.css: text-rendering: optimizeLegibility on body
triggered expensive kerning/ligature computation on all text.
- codex.css: font-feature-settings forced text shaper on every glyph.
- codex.css: hyphens: auto required dictionary lookups during layout.
- style.css: transition: all on buttons and sidebar links caused
unnecessary animation work during scroll hover state changes.
- main.ts: checkReadItems did O(n) individual querySelector calls
per scroll tick; switched to single querySelectorAll batch query.
- Polling interval reduced from 1s to 3s (scroll handler already
covers the normal case, polling is just a robustness fallback).
https://claude.ai/code/session_0187FXrbScDSWfbNEk9SfJaj
Diffstat (limited to 'frontend-vanilla/public/themes/terminal.css')
| -rw-r--r-- | frontend-vanilla/public/themes/terminal.css | 42 |
1 files changed, 25 insertions, 17 deletions
diff --git a/frontend-vanilla/public/themes/terminal.css b/frontend-vanilla/public/themes/terminal.css index dd9c1b2..48164c9 100644 --- a/frontend-vanilla/public/themes/terminal.css +++ b/frontend-vanilla/public/themes/terminal.css @@ -52,23 +52,31 @@ body { -webkit-font-smoothing: antialiased; } -/* Subtle scanline overlay -- only in dark mode */ -.theme-dark body::after { - content: ''; - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - pointer-events: none; - z-index: 9999; - background: repeating-linear-gradient( - to bottom, - transparent, - transparent 2px, - rgba(0, 0, 0, 0.03) 2px, - rgba(0, 0, 0, 0.03) 4px - ); +/* Subtle scanline overlay -- only in dark mode, desktop only. + The fixed full-viewport pseudo-element with a repeating gradient + forces GPU compositing on every scroll frame. On mobile this causes + severe jank and memory pressure, so we limit it to large screens + and promote it to its own layer with will-change to avoid repainting + the content beneath it. */ +@media (min-width: 1025px) { + .theme-dark body::after { + content: ''; + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + pointer-events: none; + z-index: 9999; + background: repeating-linear-gradient( + to bottom, + transparent, + transparent 2px, + rgba(0, 0, 0, 0.03) 2px, + rgba(0, 0, 0, 0.03) 4px + ); + will-change: transform; + } } /* ---- Sidebar ---- */ |
