All files / web/src/app/create/worksheets/constants layout.ts

0% Statements 0/27
0% Branches 0/1
0% Functions 0/1
0% Lines 0/27

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28                                                       
/**
 * Layout constants for the worksheet generator
 * These ensure consistent spacing and sizing across components
 */

export const LAYOUT_CONSTANTS = {
  /**
   * Total height to subtract from viewport for SVG preview container
   * This is the empirically determined value that prevents overflow
   * while ensuring the worksheet fits within the viewport.
   *
   * Breakdown:
   * - Nav bar: ~64px
   * - Page padding top: 80px (pt-20)
   * - Page header (title + subtitle): ~40px
   * - Preview panel chrome (header, gaps, info): ~36px
   * Total: ~220px
   */
  SVG_PREVIEW_VIEWPORT_OFFSET: 220,
} as const

/**
 * Get the CSS calc() expression for max-height of SVG preview
 */
export function getPreviewMaxHeight(): string {
  return `calc(100vh - ${LAYOUT_CONSTANTS.SVG_PREVIEW_VIEWPORT_OFFSET}px)`
}