短评 · ·

X 归档 2025-01-18

3 条动态 · 图 1 · 视频 3
Hot take: retained-mode was a premature optimization.

We built Membrane using rust and egui and never looked back. When our IDE was react-based we had to worry about reflows and re-renders. With immediate-mode every frame is a re-render! But it only takes 900us
暴论:retained-mode 是一种过早优化。

我们用 rust 和 egui 构建了 Membrane,之后再没回头。以前 IDE 基于 react 时,我们得操心 reflow 和重渲染。换到 immediate-mode 后,每一帧都是重渲染!但它只需要 900 微秒
@jh3yy09:41原推文
extra detail: animate a CSS custom property from 0 to 100 on scroll and use that for a counter()

label::after { content: counter(complete) '% complete'; }

translate the label using container query units ✨

translate: 0 calc(var(--p) * 1cqh); https://t.co/rcXBmkV3up
额外细节:滚动时把一个 CSS 自定义属性从 0 动画到 100,再喂给 counter() 使用

label::after { content: counter(complete) '% complete'; }

用容器查询单位平移标签 ✨

translate: 0 calc(var(--p) * 1cqh); https://t.co/rcXBmkV3up
Know the animated 🌈 border + glow effect that's all the rage? It's normally done by adding an opaque cover on top of two 🌈 layers.

But what if we wanted a (semi)transparent background within the border? It's possible with pure #CSS!

Heavily commented: https://codepen.io/thebabydino/pen/KwPBvzo
知道那个火遍全网的 🌈 流动边框 + 发光效果吗?通常做法是在两层 🌈 上面盖一层不透明的遮罩。

但如果我们想要边框内是(半)透明的背景呢?纯 #CSS 也能做到!

注释写得非常全:
@anatudor 的配图 1/1