Commit 6dc338f

HPCesia <me@hpcesia.com>
2026-03-16 13:48:07
Align in web support
1 parent 53643e3
Changed files (2)
src
contents
_lib
src/contents/_lib/components/align.typ
@@ -0,0 +1,34 @@
+#import "@preview/bullseye:0.1.0": target
+
+#let left(content) = context {
+  if target() == "html" {
+    html.div(
+      class: "flex flex-col items-start text-left",
+      content,
+    )
+  } else {
+    std.align(std.left, content)
+  }
+}
+
+#let center(content) = context {
+  if target() == "html" {
+    html.div(
+      class: "flex flex-col items-center text-center",
+      content,
+    )
+  } else {
+    std.align(std.center, content)
+  }
+}
+
+#let right(content) = context {
+  if target() == "html" {
+    html.div(
+      class: "flex flex-col items-end text-right",
+      content,
+    )
+  } else {
+    std.align(std.right, content)
+  }
+}
src/contents/_lib/tybios.typ
@@ -1,3 +1,4 @@
+#import "components/align.typ": center, left, right
 #import "components/frame.typ": frame
 #import "components/fullwidth.typ": fullwidth
 #import "components/marginnote.typ": marginnote