kizu

kizu.dev · Personal blog · on HN since 2023

kizu, a front-end developer, writes about advanced CSS techniques such as anchor positioning, scroll-driven styles, and fitting text to width.

What HN saysHN commenters cite his fit-to-width and CSS workaround posts as proof that tricks once thought impossible work in CSS without JavaScript.
16HN people shared it
6linked it in comments
12stories submitted
15story points
5 months agolast shared
2023people per year2026

Most-shared posts

  1. 1
    Fit-to-Width Text
    3 people · 5 points · first shared 2023 · discussion on HN
  2. 2
    Future CSS: Anchor Positioning
    3 people · 2 points · first shared 2023 · discussion on HN
  3. 3
    Position-Driven Styles
    2 people · 1 points · first shared 2023 · discussion on HN
  4. 4
    Fit to width
    2 people · first shared 2024
  5. 5
    Layered Toggles: Optional CSS Mixins
    1 people · 2 points · first shared 2024 · discussion on HN
  6. 6
    Solving Shrinkwrap: New Experimental Technique
    1 people · 2 points · first shared 2026 · discussion on HN
  7. 7
    Counters and Stones
    1 people · 1 points · first shared 2023 · discussion on HN
  8. 8
    Scroll-Driven State Transfer
    1 people · 1 points · first shared 2023 · discussion on HN
  9. 9
    Cyclic Dependency Space Toggles
    1 people · 1 points · first shared 2023 · discussion on HN
  10. 10
    Self modifying variables
    1 people · first shared 2025
  11. 11
    Svg linked parameters workaround
    1 people · first shared 2026

What HN people wrote when they linked it

eyelidlessness · 2023-06-29
Weirdly enough, with the new scroll-driven animations spec (the spec’s terminology), you can do all sorts of position-based styling without any actual scrolling taking place[1]. Of course you can also use it for its intended purpose of actually detecting scroll position. But this also unlocks a lot of other style query problems, like the cursed wrap detection. For some cases, container queries should also be sufficient. And contrary to many of the other responses here, yes I think this flexibility is important progress. There are tons of fairly straightforward (even trivially specified) layout techniques that are currently next to impossible without some combination of hardcoding measurements and/or JS, which are going to become reasonably achievable in the next year or two. That’s fantastic. And for everyone who complains about this complexity at the styling level, it’ll eventually eliminate the need for a whole class of runtime JS doing a whole bunch of inefficient calculations badly. 1: https://kizu.dev/position-driven-styles/
spiralganglion · 2026-05-29
Credit to Roman Komarov who came up with the approach [1], and Todd Matthews [2] who made the art assets. 1: https://kizu.dev/svg-linked-parameters-workaround/ 2: https://www.seaofclouds.com
kizmarh · 2025-11-26
Not by themselves, at least today, as we can't currently modify the value of a custom property by using itself in the calculation. But in the future we will have an `inherit()` functional notation that will unlock this (and at least Chrome implemented it in Canary already — https://blog.kizu.dev/play-with-inherit-function/). It is possible to use style queries and some hacks (https://kizu.dev/self-modifying-variables/) to achieve this today, but that doesn't bring this closer to production, as Firefox still does not support them (but will be soon).
swyx · 2024-11-16
i asked this on bluesky (https://bsky.app/profile/swyx.io/post/3lb2x53wuwc2y) and immiediately got this https://kizu.dev/fit-to-width/ which means theres no technical barrier now, we just need the powers that be to prioritize it anyone with influence on the CSSWG?
staminade · 2024-05-10
The article I linked goes into the details, but basically a relative approach constrains your markup: The positioned thing must be a child of the relatively positioned anchor or a wrapper element, and you often cannot sensibly position it without using JS to check the location of the anchor. E.g. a popover menu for a button must check if the button is close to an edge of the viewport and position the menu element appropriately. Anchor positioning will do this automatically. Also, if support for multiple anchors is included, then it opens up some very interesting capabilities to do things like draw arbitrary diagram connectors between elements: https://kizu.dev/anchor-positioning-experiments/
niutech · 2024-11-20
There is pure CSS solution: https://kizu.dev/fit-to-width/

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close