MCPcopy
hub / github.com/react-grid-layout/react-grid-layout / setTransform

Function setTransform

src/core/position.ts:28–45  ·  view source on GitHub ↗
({
  top,
  left,
  width,
  height
}: Position)

Source from the content-addressed store, hash-verified

26 * @returns CSS style object
27 */
28export function setTransform({
29 top,
30 left,
31 width,
32 height
33}: Position): Record<string, string> {
34 const translate = `translate(${left}px,${top}px)`;
35 return {
36 transform: translate,
37 WebkitTransform: translate,
38 MozTransform: translate,
39 msTransform: translate,
40 OTransform: translate,
41 width: `${width}px`,
42 height: `${height}px`,
43 position: "absolute"
44 };
45}
46
47/**
48 * Generate CSS top/left positioning styles.

Callers 3

GridItemFunction · 0.85
calcStyleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…