apply font-size to rendered code blocks

This commit is contained in:
Gavin Nishizawa 2023-09-25 12:10:09 -07:00
parent f35ba8e86b
commit 65d03f2ffc
No known key found for this signature in database
GPG key ID: AE3B177777CE55CD

View file

@ -1267,7 +1267,9 @@ func drawShape(writer, appendixWriter io.Writer, diagramHash string, targetShape
if !isLight {
class = "dark-code"
}
fmt.Fprintf(writer, `<g transform="translate(%f %f)" class="%s">`, box.TopLeft.X, box.TopLeft.Y, class)
fmt.Fprintf(writer, `<g transform="translate(%f %f)" class="%s" style="font-size:%v">`,
box.TopLeft.X, box.TopLeft.Y, class, targetShape.FontSize,
)
rectEl := d2themes.NewThemableElement("rect")
rectEl.Width = float64(targetShape.Width)
rectEl.Height = float64(targetShape.Height)