经过这么长时间后我可以删除的字节

For the last few years my work-work has mostly focused on back end software (particularly around APIs). This meant that any front end work I was doing was for myself.

过去几年,我的工作主要集中在后端软件(特别是 API 方面)。这意味着我做的任何前端工作都是为了自己。

Being an long-in-the-tooth old dog, I tend to learn and trick, and roll it out again and again typically without taking the time to find whether I still need the trick. Case and point, I learnt about the JavaScript performance trick of ~~1.4 === 1 to floor a value (and the same float | 0) but really these days it's not "faster" than doing it the legible way (i.e. Math.floor(1.4)).

作为一个老江湖,我倾向于学到一个技巧就反复使用,通常不花时间检查是否还需要它。典型例子,我学到了 JavaScript 性能技巧 ~~1.4 === 1 来对值取整(同样 float | 0),但如今它并不比可读的方式(即 Math.floor(1.4))"更快"。

Given I've had a bit of time away from the backend, here's an unorganised list of things I've found I can use, and thusly remove extra code that I no longer need.

鉴于我有一段时间远离后端,这里是一个无序列表,列出我发现可以使用的功能,从而移除我不再需要的多余代码。

[

[

MY EBOOK**£5 for Working the Command Line**

我的电子书**£5 for Working the Command Line**

Gain command-line shortcuts and processing techniques, install new tools and diagnose problems, and fully customize your terminal for a better, more powerful workflow.

获得命令行快捷方式和处理技巧,安装新工具并诊断问题,完全自定义您的终端,打造更好、更强大的工作流程。

£5 to own it today

£5 今天即可拥有

](https://ko-fi.com/s/57e38e71bb)

](https://ko-fi.com/s/57e38e71bb)

The list

列表

  1. CSS: text-underline-offset - the distance I can set the text-underline-offset: 12px
  2. CSS: text-underline-offset - 我可以设置文本下划线偏移的距离:12px
  3. CSS: gap - no more faffing with margins in flexbox.
  4. CSS: gap - 不再需要在 flexbox 中折腾 margins。
  5. CSS: nested media queries on selectors (and nesting general):
  6. CSS: 选择器上的嵌套媒体查询(以及一般的嵌套):
h1 { font-size: 1rem; @media (min-width: 600px) { font-size: 2rem; }
}
  1. CSS: clamp(min, variable, max) - I used this extensively on FFConf 2025's css, the process of finding the right values is very much
  2. CSS: clamp(min, variable, max) - 我在 FFConf 2025 的 css 中广泛使用了它,寻找正确值的过程非常
  3. CSS: content: open-quote can localised quotes and the q tag does this by default, via this neat ...
开通本站会员,查看完整译文。

ホーム - Wiki
Copyright © 2011-2026 iteam. Current version is 2.148.4. UTC+08:00, 2026-01-24 19:36
浙ICP备14020137号-1 $お客様$