diff --git a/packages/typst.ts/examples/typst.ts.css b/packages/typst.ts/examples/typst.ts.css index d450e899..87cdebe0 100644 --- a/packages/typst.ts/examples/typst.ts.css +++ b/packages/typst.ts/examples/typst.ts.css @@ -8,6 +8,10 @@ body { margin: 0; } +.typst-page.canvas { + margin: 0; +} + .text-layer { position: relative; left: 0; diff --git a/packages/typst.ts/src/render/canvas/view.mts b/packages/typst.ts/src/render/canvas/view.mts index a1a91001..a48afbb9 100644 --- a/packages/typst.ts/src/render/canvas/view.mts +++ b/packages/typst.ts/src/render/canvas/view.mts @@ -71,6 +71,8 @@ export class RenderView { annotationLayer.style.width = `${containerWidth}px`; annotationLayer.style.height = `${height * orignalScale}px`; annotationLayer.style.position = 'absolute'; + commonDiv.classList.add('typst-page'); + commonDiv.classList.add('canvas'); commonDiv.style.width = `${containerWidth}px`; commonDiv.style.height = `${height * orignalScale}px`; commonDiv.style.position = 'relative';