mirror of
https://github.com/wu736139669/hapi.git
synced 2026-11-24 04:47:03 +00:00
11 lines
436 B
TypeScript
11 lines
436 B
TypeScript
/**
|
|
* The line-number cells use `px-3`, so their grid track must include both
|
|
* horizontal padding edges or a three-digit line number can crowd the code.
|
|
* Keep this calculation shared by CodeBlock and Markdown's highlighter.
|
|
*/
|
|
const CODE_GUTTER_HORIZONTAL_PADDING_REM = 1.5
|
|
|
|
export function getCodeGutterTrack(lineNumberWidth: number): string {
|
|
return `calc(${lineNumberWidth}ch + ${CODE_GUTTER_HORIZONTAL_PADDING_REM}rem)`
|
|
}
|