# Use buffer size for markdown preview \(\#29172\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/38afae86a91a35d1bd3b2768c1f50da825bd4d6b)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 38afae86a91a35d1bd3b2768c1f50da825bd4d6b

Requested commit: 38afae86a91a35d1bd3b2768c1f50da825bd4d6b

Commit: 38afae86a91a35d1bd3b2768c1f50da825bd4d6b

Tree: 58e0764b793304a93979b5b05194f85e73d5e779

Author: Mikayla Maki

Committer: GitHub

## Message

```
Use buffer size for markdown preview (#29172)

Note:

This is implemented in a very hacky and one-off manner. The primary
change is to pass a rem size through the markdown render tree, and scale
all sizing (rems & pixels) based on the passed in rem size manually.
This required copying in the `CheckBox` component from `ui::CheckBox` to
make it use the manual rem scaling without modifying the `CheckBox`
implementation directly as it is used elsewhere.

A better solution is required, likely involving `window.with_rem_size`
and/or _actual_ `em` units that allow text-size-relative scaling.

Release Notes:

- Made it so Markdown preview uses the _buffer_ font size instead of the
_ui_ font size.

---------

Co-authored-by: Ben Kunkle <ben@zed.dev>
Co-authored-by: Nate Butler <nate@zed.dev>
```

## Parents

- [9249919b7adca924b00dd2ded4a4b4e5f2e01237](https://git.cafe/gitcafe/zed/commit/9249919b7adca924b00dd2ded4a4b4e5f2e01237?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/38afae86a91a35d1bd3b2768c1f50da825bd4d6b?format=markdown)
