Skip to content

Commit bcae5bd

Browse files
zombieJclaude
andcommitted
feat: support configurable transform-origin per placement
- Add @transformorigin parameter to placement mixin - Top positions use 'center bottom' for transform origin - Bottom positions use 'center top' for transform origin Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c0c8351 commit bcae5bd

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

assets/geek.less

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,15 @@
44
@notificationMotionEase: cubic-bezier(0.22, 1, 0.36, 1);
55
@notificationMotionOffset: 64px;
66

7-
.generate-placement(@placement, @vertical, @horizontal, @flexDirection, @stackClip, @motionX) {
7+
.generate-placement(
8+
@placement,
9+
@vertical,
10+
@horizontal,
11+
@flexDirection,
12+
@transformOrigin,
13+
@stackClip,
14+
@motionX
15+
) {
816
&-@{placement} {
917
@{vertical}: 0;
1018
@{horizontal}: 0;
@@ -14,7 +22,7 @@
1422
.@{notificationPrefixCls}-notice {
1523
@{vertical}: var(--notification-y, 0);
1624
@{horizontal}: var(--notification-x, 0);
17-
transform-origin: center bottom;
25+
transform-origin: @transformOrigin;
1826
}
1927

2028
.notification-fade-appear-prepare,
@@ -74,6 +82,7 @@
7482
top,
7583
right,
7684
column,
85+
~'center bottom',
7786
inset(50% -50% -50% -50%),
7887
@notificationMotionOffset
7988
);
@@ -82,6 +91,7 @@
8291
bottom,
8392
right,
8493
column-reverse,
94+
~'center top',
8595
inset(-50% -50% 50% -50%),
8696
@notificationMotionOffset
8797
);
@@ -90,6 +100,7 @@
90100
top,
91101
left,
92102
column,
103+
~'center bottom',
93104
inset(50% -50% -50% -50%),
94105
-@notificationMotionOffset
95106
);
@@ -98,6 +109,7 @@
98109
bottom,
99110
left,
100111
column-reverse,
112+
~'center top',
101113
inset(-50% -50% 50% -50%),
102114
-@notificationMotionOffset
103115
);

0 commit comments

Comments
 (0)