Skip to content

1681-engine / react / windowStyle

Function: windowStyle() ​

ts
function windowStyle(
   wanted, 
   viewport, 
   options?
): object;

Defined in: src/react/placement.ts:15

Where a window or dialog of wanted size stands: fitted into the viewport by fitToViewport (shrunk to its minScale, then cut, then moved inside the edges), centred unless wanted has an x/y. The style places it in whole pixels with left/top, never translate(-50%), and caps its size so its body scrolls.

Parameters ​

ParameterType
wanted| Size | Rect
viewportSize
optionsFitOptions

Returns ​

object

fit ​

ts
fit: FitResult;

style ​

ts
style: CSSProperties;

Released under the MIT License.