StringTune/Docs

API Reference

ViewportState

Internal model for viewport dimensions, content bounds, transform scale, and rem base.

ViewportState

ViewportState holds current viewport and content geometry.

Public status

ViewportState lives in src/states and is mainly runtime reference. Most integrations should read it through exported StringData.

Important fields

  • windowWidth
  • windowHeight
  • contentWidth
  • contentHeight
  • scaleWidth
  • scaleHeight
  • transformScale
  • baseRem

What it is for

This state powers:

  • resize-aware modules
  • dimension parsing
  • transformed container calculations
  • responsive behavior

Practical note

If a module depends on viewport size, root font size, or transformed layout scaling, the needed values usually live in data.viewport.