Solar Eclipse Toggle Web Component (two state dark/light mode toggle)
Zach Leatherman · 2026年9月14日
AI 摘要 AI 生成,可能有误
作者将其双态暗色/亮色模式切换实验转化为一个名为 @zachleat/solar-eclipse-toggle 的可复用 Web 组件,并融入了 Curtis Wilcox 的无障碍反馈,随后将其发布在 GitHub 和 npm 上。该组件的亮点包括:在 JavaScript 加载之前按钮处于惰性(inert)状态、无累积布局偏移(CLS)、在 CSS 加载失败时仍能保持功能正常,以及通过从 light DOM 插入字符串来支持国际化。
In Trying out a Two-state Dark Mode Toggle I summarized the Two-state Dark and Light mode Toggle discussion as I experimented with a toggle in my personal website footer.
I decided to fold this into a reusable component so that I can benefit from this work on future websites (and you can use it too, I guess!). It’s called @zachleat/solar-eclipse-toggle and you can find it on GitHub or on npm now.
继续阅读全文
为了尊重作者,这里只展示开头几段。你可以去原文阅读,或者在 HorizonReader 里读:划线做笔记、让 AI 帮忙。
AI 摘要This article argues that npm audit results can be misleading because tools like Next.js bundle 139 of their own dependencies outside of standard auditing mechanisms, hiding 3 critical vulnerabilities—more hidden critical vulnerabilities than visible ones in the no-longer-maintained Gatsby. Similar practices of bundling dependencies or suppressing audit output exist in Vite, various create- CLI tools, and package managers like pnpm and yarn, undermining transparency in security auditing. The author built the Prototype Pollution Report, a daily-updating comparison of vulnerability counts across framework ecosystems, to normalize these discrepancies and provide clearer security insight.
AI 摘要The article introduces a Firefox addon the author built to manage their habit of hoarding 300+ browser tabs. The addon provides features such as sorting tabs by recency, detecting duplicates, searching/filtering by title or URL, full undo/redo support, and a 'Saved' section for storing tabs to restore later. It also supports multi-account containers, identifies tabs playing audio, shows stale tabs, offers light and dark modes, and can merge all tabs into a single window.
AI 摘要The author reflects skeptically on the current AI-driven wave of development tooling—agents that plan, write, review, and orchestrate code—questioning whether these developer-experience improvements actually translate into better software for real users, just as similar promises around client-side rendering and the single-page-application era failed to do. Citing anecdotal declines in software reliability and poor performance/accessibility scores among AI-related sites, the author suspects this cycle repeats the old playbook at an accelerated pace. They conclude that craft, defined as caring about the quality of output regardless of the tools used to produce it, is more important than ever.
AI 摘要The author introduces , a web component that makes icons (including emoji) fall across a website, created as a follow-up to . Originally built as an easter egg for Blog Awesome, it is now publicly available on GitHub and installable via npm. It offers configuration options for the icon count and a customizable, comma-separated list of colors.
AI 摘要The article introduces a zero-CSS table of contents web component that can either progressively enhance server-rendered or hierarchies or client-render them, highlighting which headings are currently visible in the viewport. Extracted from the WebC Tugboat starter project for standalone use, it is available on npm as @zachleat/table-of-contents, with demos shown on the author's blog and Blog Awesome. Developers can configure a selector attribute to control the heading search scope, defaulting to main :is(h2, h3, h4, h5, h6).