Nâng CaoCSS iconCSS

Fluid typography công thức thế nào?

Fluid typography để font-size tự co giãn mượt mà theo viewport thay vì nhảy đột ngột qua media queries. Dùng clamp(): font-size: clamp(1rem, 0.5rem + 1.5vw, 2rem) — tối thiểu 1rem, tối đa 2rem, tuyến tính ở giữa.

Công thức tính preferred value: minSize + (maxSize - minSize) * ((100vw - minViewport) / (maxViewport - minViewport)).

Tính nhanh: dùng utopia.fyi — nhập min/max size + viewport range, tool generate sẵn clamp value.

Xem toàn bộ CSS cùng filter theo level & chủ đề con.

Mở danh sách CSS