跳到正文
网页珍奇柜Web Curio

等宽网格网页

The Monospace Web,Oskar Wickström,2024 年

正在布展…

原作直展:这是 Oskar Wickström 的原始作品,按 MIT(附带 JetBrains Mono 字体为 OFL) 许可证收录(版本 6992b7c)。原样展出整页宣言,字体改为本地打包的同款 JetBrains Mono;页中一段 47 MB 的维基共享资源影片没有收录,只保留链接。右上角勾选 Debug mode 可叠加显示字符网格。 许可证全文 · 收录说明

它是怎么做的

  1. 第 1 步以 1ch 和 1 行高(rem)作为全局网格单位。
  2. 第 2 步所有 margin/padding/border 都用这两个单位的整数倍。
  3. 第 3 步用 JS 微调图片和媒体高度,让它们落在行高倍数上。
  4. 第 4 步提供调试开关,叠加显示网格以检查对齐。

复刻配方

一段技术配方,可以直接交给 AI 编程助手,也可以自己照着写。想指定技术栈、位置和性能预算,就把它加入实现方案。

Pick a monospace font and set a custom property for line height in rem; define every spacing token as multiples of 1ch horizontally and of that line height vertically. Draw borders and tables with box-drawing characters or with borders whose thickness is compensated by negative margins so total height stays on-grid. Add a tiny script that rounds image heights up to the nearest line-height multiple. Include a toggleable background-image grid overlay made from repeating-linear-gradient for debugging.

档案

技术

交互

能不能拿来用

原作以 MIT 许可开源:可以阅读源码学习,按许可证条款使用;在自己的项目里引用时保留原作者署名。

性能开销

视觉强度

实现难度

尺度为策展判断(1 到 5),用于比较和推荐。

核实记录:Live page loads (HTTP 200, title 'The Monospace Web'); gh api: MIT, created 2024-08-25.