tinymist/tools/typst-preview-frontend
hyrious c7b10d1b6c
Some checks failed
tinymist::auto_tag / auto-tag (push) Has been cancelled
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / announce (push) Has been cancelled
tinymist::ci / build (push) Has been cancelled
feat: preview page remove extra space and do not invert background (#2094)
| Before | After |
| ------ | ----- |
| <img width="300" height="246" alt="image"
src="https://github.com/user-attachments/assets/3f1e9d69-390c-46ce-8469-52d90c052fed"
/> | <img width="303" height="243" alt="image"
src="https://github.com/user-attachments/assets/4b70a9d2-07c6-496e-82df-d0ad27bd582e"
/> |

1. The `svg` element by default has `display: inline`, which adds extra
space at bottom (line height), change that to `block` can remove the
space.
2. The `svg` element and its outer `div` both set background color,
which will be inverted to another color that are not equal to the whole
page's background (I was setting `--main-margin` to see the outside).
This PR prevents the background from getting inverted.

There's another tiny thing: `#typst-container.mode-doc` has `margin-top:
-1px` which shifts the whole Typst doc 1px up. That will cause the page
always has 1px margin at bottom because the SVG element has the full
height. One possible fix is to always `- 1px` on the SVG `height`
attribute but I'm not sure if this affects some calculation. So I'm not
adding this trivial change.
2025-09-02 12:55:12 +08:00
..
src feat: preview page remove extra space and do not invert background (#2094) 2025-09-02 12:55:12 +08:00
.gitignore feat: move typst-preview to tinymist (#323) 2024-06-17 17:22:45 +08:00
index.html feat: auto-hide presentation toolbar when not hovered (#1923) 2025-07-25 18:31:35 +08:00
package.json build: make use of async io of js to speed up vscode builds (#2069) 2025-08-31 18:34:20 +08:00
tsconfig.json feat: move typst-preview to tinymist (#323) 2024-06-17 17:22:45 +08:00
vite.config.js feat: move typst-preview to tinymist (#323) 2024-06-17 17:22:45 +08:00