Skip to content

Commit 493d550

Browse files
update figma rotation docs
1 parent 8abcfaa commit 493d550

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

docs/figma-rotation.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,37 @@ revision: 1
1212

1313
> Figma rotation from [figma plugin docs](https://www.figma.com/plugin-docs/api/properties/nodes-rotation/#docsNav)
1414
15+
## [Note] The rotation value needs to be inverted on the client side.
16+
17+
to rotate something to the clockwise direction,
18+
19+
- figma: -n
20+
- client: +n (css)
21+
22+
the transform origin
23+
24+
- figma: not specified (always top left)
25+
- client: top left
26+
27+
**so the conversion from figma to css will be like below**
28+
29+
```
30+
# figma
31+
{
32+
x: 100,
33+
y: 100,
34+
rotation: 10,
35+
}
36+
37+
# css
38+
.rotate-n {
39+
top: 100;
40+
left: 100;
41+
transform: rotate(-10deg);
42+
transform-origin: top left;
43+
}
44+
```
45+
1546
## Transform?
1647

1748
While figma and other major design tools has both transform value, and explicit rotation value (which can be calculated from transform value), The intuitive way to represent a rotation value is by using a `Rotation` token. Overall all figma node properties, the only two property that has impact to final transform (based on css) is `scale` and `rotation`.

0 commit comments

Comments
 (0)