textmachine/frontend/src/tokens/measures.ts

18 lines
752 B
TypeScript

// The numbers needed not by the styles but by the code: the virtualiser computes the layout itself
// and does not look into CSS, so the row height has to be handed to it as a number. The source of
// truth is still a single one — tokens.css: the lock in tokens.test.ts checks every value from here
// against the token of the same name and fails on a divergence.
export const measures = {
'--row-height': 26,
'--row-height-term': 46,
'--row-height-table': 32,
'--column-fit-max': 260,
'--column-min': 110,
'--panel-side-width': 320,
'--panel-side-min': 220,
'--panel-side-max': 900,
'--panel-context-width': 620,
'--panel-context-min': 532,
} as const;
export const px = (name: keyof typeof measures) => `${measures[name]}px`;