Skip to content

Commit 8e78b99

Browse files
authored
Allow relative width in fit-to-width
1 parent 1860c27 commit 8e78b99

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

utils/utils.typ

+2
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@
133133
style(styles => {
134134
let content-size = measure(content, styles)
135135
let content-width = content-size.width
136+
// Convert percent/em into concrete units
137+
let width = measure(h(width), styles).width
136138
if width < content-width {
137139
let ratio = width / content-width * 100%
138140
// The first box keeps content from prematurely wrapping

0 commit comments

Comments
 (0)