# markdown_preview: Add font size settings and actions \(\#55489\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 46ff888db8530df7798451eff82f428d2e033eab

Requested commit: 46ff888db8530df7798451eff82f428d2e033eab

Commit: 46ff888db8530df7798451eff82f428d2e033eab

Tree: e570f95788eacd62e595fa4e59c7bdd26db5516e

Author: David Alecrim

Committer: GitHub

## Message

```
markdown_preview: Add font size settings and actions (#55489)

Add support for scaling the Markdown preview's body text and headings
with `cmd-=` / `cmd--` / `cmd-0`. Previously these shortcuts only
resized code blocks because the preview's body used `ui_font_size` and
headings used a rem-based scale anchored to it, while the keybindings
only mutated `BufferFontSize`.

The preview's scroll subtree is now wrapped in
`WithRemSize(buffer_font_size)`, so `1rem` resolves to the buffer font
size inside the preview. Body text, headings
(`text_3xl`/`text_2xl`/...), and rem-based spacing all scale together.
The outer focus root and scrollbar remain at the UI font size.

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #55374

Release Notes:

- Added `markdown_preview_font_size` setting and actions to scale
Markdown preview font size separately from the editor.

---------

Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
```

## Parents

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

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