📌 安装书签
📌 Install the bookmark
在任意 Stacks Project 页面点一下书签即可切换深色模式:第一次点击开启深色,之后每点一次就在深色与浅色之间切换。
On any Stacks Project page, click the bookmark to toggle dark mode: the first click turns dark mode on, and every click after that switches between dark and light.
⚠️ 不要用 ⌘D / Ctrl+D「添加书签」保存本页——那样存下来的网址是本页地址,点它只会跳回这一页,深色模式不会生效。请用下面任一种方式安装;装好后请确认书签的网址以 javascript: 开头。
⚠️ Do not use ⌘D / Ctrl+D “Add bookmark” on this page — that stores this page's address, so clicking it only comes back here and dark mode never runs. Use method A or B below. Either way, check that the bookmark's URL starts with javascript:.
方式 A · 拖拽(最快)
Method A · Drag (fastest)
- 按住上面的 「🌙 Stacks Dark」 按钮
- 拖到浏览器的书签栏
- 打开任意一个 Stacks Project 页面
- 点击书签栏里的 🌙 Stacks Dark(再点一次即切回浅色)
- Press and hold the 🌙 Stacks Dark button above
- Drag it to your browser's bookmarks bar
- Open any Stacks Project page
- Click the 🌙 Stacks Dark bookmark (click again to switch back)
方式 B · 复制代码后手动新建书签(最可靠)
Method B · Copy the code, then create the bookmark by hand (most reliable)
拖拽失败、或不确定书签存对没有时用这个方式——手动粘贴不会存错网址。
Use this when dragging fails or you are unsure the bookmark was stored correctly — pasting by hand cannot capture the wrong URL.
下面是完整代码。复制按钮不可用时,直接选中这一段复制即可:
The full snippet is below. If the copy button is unavailable, just select this block and copy it:
- 点上面的按钮复制代码(
javascript:开头也要一起复制) - 在书签栏空白处右键 → 「添加网页…」
- 名称填 Stacks Dark
- ⚠️ 把「网址」栏里预填的本页地址整段删掉,再粘贴刚复制的代码
(这一步漏掉,存下来的就是本页网址——点它只会跳回这一页。) - 保存 → 打开任意 Stacks Project 页面 → 点这个书签
- Click the button above to copy the code (keep the leading
javascript:) - Right-click the bookmarks bar → “Add page…”
- Name it Stacks Dark
- ⚠️ Delete the pre-filled address in the URL field entirely, then paste the snippet
(Skip this and the bookmark stores this page's address — clicking it just comes back here.) - Save → open any Stacks Project page → click the bookmark
💡 更稳妥的做法:按 ⌘⌥B 打开书签管理器 → 右上角 「添加新书签」—— 那里的网址栏是空的,直接粘贴不会存错。
💡 More reliable: press ⌘⌥B to open the bookmark manager → “Add new bookmark”. Its URL field is empty, so a paste cannot capture the wrong address.
✅ 自检:编辑该书签,网址应以 javascript:(function(){ 开头、以 })(); 结尾。若显示的是 https://kanghelyu.org/…,说明存错了,请删掉重做。
✅ Self-check: edit the bookmark — its URL should start with javascript:(function(){ and end with })();. If it shows https://kanghelyu.org/…, it was saved wrong; delete it and redo.
方式 C · 油猴脚本(装一次,永久生效)
Method C · Userscript (install once, always on)
不想折腾书签就用这个:装一次之后,每个 Stacks Project 页面都会自动应用深色模式,不用点任何东西。需要先装 Tampermonkey 扩展。
Skip the bookmark entirely: install this once and every Stacks Project page gets dark mode automatically, with nothing to click. Requires the Tampermonkey extension.
- 装好 Tampermonkey 扩展
- 点上面这个链接,Tampermonkey 会弹出安装页 → 点「安装」
- 打开任意 Stacks Project 页面,应当自动变黑
- Install the Tampermonkey extension
- Click the link above — Tampermonkey opens its install page → click “Install”
- Open any Stacks Project page; it should turn dark on its own
开启后,页面顶部导航栏会出现一个切换开关,之后不点书签也能随时切换;选择会被记住。
Once active, a switch appears in the page header, so you can toggle without the bookmark. Your choice is remembered.
⚡ Ctrl+Shift+D 快捷键
⚡ Keyboard shortcut
在任何 Stacks Project 页面上按 Ctrl+Shift+D(Mac: Cmd+Shift+D)一键切换深色模式。注意:需要先用书签或控制台方式注入一次脚本,快捷键才会生效。
Press Ctrl+Shift+D (Mac: Cmd+Shift+D) on any Stacks Project page to toggle dark mode. Note: the script must be injected once (via bookmarklet or console) before the shortcut works.
🖥 控制台注入(临时测试)
🖥 Console injection (quick test)
打开 Stacks Project 页面的开发者工具(F12 → Console),粘贴以下代码然后回车:
Open developer tools on any Stacks Project page (F12 → Console), paste the code and press Enter:
// 已注入过则直接切换,否则加载脚本与样式表
if (window.__stacksDarkToggle) { window.__stacksDarkToggle(); }
else {
var s = document.createElement('script');
s.src = 'https://cdn.jsdelivr.net/gh/kanghelyu/kanghelyu.github.io@db1add94eb02e94f8764c63e42ce2763a2e8148a/stacks-dark/dark-mode.js';
document.body.appendChild(s);
var l = document.createElement('link');
l.rel = 'stylesheet';
l.href = 'https://cdn.jsdelivr.net/gh/kanghelyu/kanghelyu.github.io@db1add94eb02e94f8764c63e42ce2763a2e8148a/stacks-dark/dark-mode.css';
document.head.appendChild(l);
}🖼 效果预览
🖼 Preview
Lemma 10.2 — Let 0001 be a scheme and let $X$ be a ...
Lemma 10.3. Let $f : X \to Y$ be a morphism of schemes. The following are equivalent:
- $f$ is locally of finite type,
- for every affine open $V \subset Y$, $f^{-1}(V)$ can be covered by affines ...
📂 静态文件 CDN 链接
📂 CDN file links
你也可以直接引用这些文件(jsDelivr CDN,带正确 MIME 类型):
You can also reference these files directly via jsDelivr CDN (correct MIME types included):