What is `v(-1fr)`? Why does it work?

#set page(header: [
  Hello
  
  #v(-1fr)
  #v(1mm)
  #line(length: 100%)
])
World

I randomly figured out v(-1fr) conveniently cancels vertical spacing, making layout explicit. But why?

Comparison

Turns out Typst automatically clamps negative values to zero. Thanks Raf for the answer.

https://typst.app/project/r5Aucfojuk4P9Zb5HXjP8x

Project link :link: is broken :warning:

Updated

1 Like

The only thing that cancels spacing is weak spacing like v(0pt, weak: true).