Files
stack/packages/mosaic/framework/skills/slidev/references/code-max-height.md
T
fargo 1a822493ba format: apply repo prettier (3.8.1) to the folded skills tree
963 markdown files reformatted with the repository's pinned prettier so
pnpm format:check covers the folded tree like every other repo file.

The formatter's embedded-language pass also normalized code fences
(TS semicolons, closed HTML tags in examples, lowercased CSS hex colors,
one renumbered list that skipped an index). Alphanumeric token deltas vs
the fold commit were audited file-by-file; all are formatter-equivalent
markup normalizations plus the four sanitized skills.
2026-08-19 14:37:17 -05:00

653 B

name, description
name description
max-height Set a fixed height for code blocks with scrolling for long code

Code Block Max Height

Set a fixed height for code blocks with scrolling.

Usage

```ts {2|3|7|12}{maxHeight:'100px'}
function add(a: Ref<number> | number, b: Ref<number> | number) {
  return computed(() => unref(a) + unref(b));
}
/// ...as many lines as you want
const c = add(1, 2);
```

With Line Highlighting Placeholder

Use {*} when you only need maxHeight:

```ts {*}{maxHeight:'100px'}
// long code here
```

Use Case

When code is too long to fit on one slide but you want to show it all with scrolling.