Skip to content

Commit

Permalink
dev(pkg::core): add a page class for css selector
Browse files Browse the repository at this point in the history
  • Loading branch information
Myriad-Dreamin committed Sep 29, 2023
1 parent af471a0 commit b71a88f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/typst.ts/examples/typst.ts.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ body {
margin: 0;
}

.typst-page.canvas {
margin: 0;
}

.text-layer {
position: relative;
left: 0;
Expand Down
2 changes: 2 additions & 0 deletions packages/typst.ts/src/render/canvas/view.mts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit b71a88f

Please sign in to comment.