@veltra/styles 1.15.0 → 1.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,11 +3,14 @@
3
3
  .slide-up-leave-to {
4
4
  opacity: 0;
5
5
  }
6
- .slide-down-enter-active, .slide-down-leave-active,
7
- .slide-up-enter-active,
8
- .slide-up-leave-active {
6
+ .slide-down-enter-active,
7
+ .slide-up-enter-active {
9
8
  transition: transform 0.2s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.2s cubic-bezier(0.23, 1, 0.32, 1);
10
9
  }
10
+ .slide-down-leave-active,
11
+ .slide-up-leave-active {
12
+ transition: transform 0.15s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.15s cubic-bezier(0.23, 1, 0.32, 1);
13
+ }
11
14
 
12
15
  .slide-down-enter-from, .slide-down-leave-to {
13
16
  transform: translateY(-10px);
@@ -5,12 +5,18 @@
5
5
  opacity: 0;
6
6
  }
7
7
 
8
- &-enter-active,
9
- &-leave-active {
8
+ &-enter-active {
10
9
  transition:
11
10
  transform 0.2s cubic-bezier(0.23, 1, 0.32, 1),
12
11
  opacity 0.2s cubic-bezier(0.23, 1, 0.32, 1);
13
12
  }
13
+
14
+ // 出场比入场快
15
+ &-leave-active {
16
+ transition:
17
+ transform 0.15s cubic-bezier(0.23, 1, 0.32, 1),
18
+ opacity 0.15s cubic-bezier(0.23, 1, 0.32, 1);
19
+ }
14
20
  }
15
21
 
16
22
  .slide-down {
@@ -1,6 +1,7 @@
1
1
  @keyframes spring-in {
2
2
  0% {
3
- scale: 0;
3
+ scale: 0.9;
4
+ opacity: 0;
4
5
  }
5
6
  40% {
6
7
  scale: 1.1;
@@ -28,7 +29,22 @@
28
29
  }
29
30
 
30
31
  .spring-leave-to {
31
- scale: 0;
32
+ scale: 0.96;
32
33
  translate: 0 0 !important;
33
34
  opacity: 0;
34
35
  }
36
+
37
+ @media (prefers-reduced-motion: reduce) {
38
+ .spring-enter-active {
39
+ animation: none;
40
+ transition: opacity 0.2s ease;
41
+ }
42
+ .spring-leave-active {
43
+ transition-property: opacity;
44
+ }
45
+ .spring-enter-from,
46
+ .spring-leave-to {
47
+ scale: 1;
48
+ opacity: 0;
49
+ }
50
+ }
@@ -2,7 +2,8 @@
2
2
  // 避免动画与拖拽内联样式互相覆盖、动画结束瞬间内联 transform 反扑导致跳帧
3
3
  @keyframes spring-in {
4
4
  0% {
5
- scale: 0;
5
+ scale: 0.9;
6
+ opacity: 0;
6
7
  }
7
8
  40% {
8
9
  scale: 1.1;
@@ -34,8 +35,26 @@
34
35
  }
35
36
 
36
37
  .spring-leave-to {
37
- scale: 0;
38
+ scale: 0.96;
38
39
  // 离开时归位到中心 (即便此前被拖拽过), 与原行为一致; !important 用于覆盖拖拽内联样式
39
40
  translate: 0 0 !important;
40
41
  opacity: 0;
41
42
  }
43
+
44
+ // 减弱动态效果:不缩放,只保留透明度
45
+ @media (prefers-reduced-motion: reduce) {
46
+ .spring-enter-active {
47
+ animation: none;
48
+ transition: opacity 0.2s ease;
49
+ }
50
+
51
+ .spring-leave-active {
52
+ transition-property: opacity;
53
+ }
54
+
55
+ .spring-enter-from,
56
+ .spring-leave-to {
57
+ scale: 1;
58
+ opacity: 0;
59
+ }
60
+ }
@@ -9,32 +9,35 @@
9
9
  .zoom-in-bottom-leave-to {
10
10
  opacity: 0;
11
11
  }
12
- .zoom-in-enter-active, .zoom-in-leave-active,
12
+ .zoom-in-enter-active,
13
13
  .zoom-in-left-enter-active,
14
- .zoom-in-left-leave-active,
15
14
  .zoom-in-right-enter-active,
16
- .zoom-in-right-leave-active,
17
15
  .zoom-in-top-enter-active,
16
+ .zoom-in-bottom-enter-active {
17
+ transition: opacity 0.15s cubic-bezier(0.23, 1, 0.32, 1), transform 0.15s cubic-bezier(0.23, 1, 0.32, 1);
18
+ }
19
+ .zoom-in-leave-active,
20
+ .zoom-in-left-leave-active,
21
+ .zoom-in-right-leave-active,
18
22
  .zoom-in-top-leave-active,
19
- .zoom-in-bottom-enter-active,
20
23
  .zoom-in-bottom-leave-active {
21
- transition: opacity 0.15s cubic-bezier(0.23, 1, 0.32, 1), transform 0.15s cubic-bezier(0.23, 1, 0.32, 1);
24
+ transition: opacity 0.12s cubic-bezier(0.23, 1, 0.32, 1), transform 0.12s cubic-bezier(0.23, 1, 0.32, 1);
22
25
  }
23
26
 
24
27
  .zoom-in-left-enter-from, .zoom-in-left-leave-to,
25
28
  .zoom-in-right-enter-from,
26
29
  .zoom-in-right-leave-to {
27
- transform: scaleX(0.8);
30
+ transform: scaleX(0.9);
28
31
  }
29
32
 
30
33
  .zoom-in-top-enter-from, .zoom-in-top-leave-to,
31
34
  .zoom-in-bottom-enter-from,
32
35
  .zoom-in-bottom-leave-to {
33
- transform: scaleY(0.8);
36
+ transform: scaleY(0.9);
34
37
  }
35
38
 
36
39
  .zoom-in-enter-from, .zoom-in-leave-to {
37
- transform: scale(0.8);
40
+ transform: scale(0.9);
38
41
  }
39
42
 
40
43
  .zoom-in-left-enter-active, .zoom-in-left-leave-active {
@@ -8,19 +8,25 @@
8
8
  opacity: 0;
9
9
  }
10
10
 
11
- &-enter-active,
12
- &-leave-active {
11
+ &-enter-active {
13
12
  transition:
14
13
  opacity 0.15s cubic-bezier(0.23, 1, 0.32, 1),
15
14
  transform 0.15s cubic-bezier(0.23, 1, 0.32, 1);
16
15
  }
16
+
17
+ // 出场比入场快
18
+ &-leave-active {
19
+ transition:
20
+ opacity 0.12s cubic-bezier(0.23, 1, 0.32, 1),
21
+ transform 0.12s cubic-bezier(0.23, 1, 0.32, 1);
22
+ }
17
23
  }
18
24
 
19
25
  .zoom-in-left,
20
26
  .zoom-in-right {
21
27
  &-enter-from,
22
28
  &-leave-to {
23
- transform: scaleX(0.8);
29
+ transform: scaleX(0.9);
24
30
  }
25
31
  }
26
32
 
@@ -28,14 +34,14 @@
28
34
  .zoom-in-bottom {
29
35
  &-enter-from,
30
36
  &-leave-to {
31
- transform: scaleY(0.8);
37
+ transform: scaleY(0.9);
32
38
  }
33
39
  }
34
40
 
35
41
  .zoom-in {
36
42
  &-enter-from,
37
43
  &-leave-to {
38
- transform: scale(0.8);
44
+ transform: scale(0.9);
39
45
  }
40
46
  }
41
47
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veltra/styles",
3
- "version": "1.15.0",
3
+ "version": "1.15.1",
4
4
  "homepage": "https://github.com/cabinet-fe/ultra-ui#readme",
5
5
  "bugs": {
6
6
  "url": "https://github.com/cabinet-fe/ultra-ui/issues"
@@ -5,12 +5,18 @@
5
5
  opacity: 0;
6
6
  }
7
7
 
8
- &-enter-active,
9
- &-leave-active {
8
+ &-enter-active {
10
9
  transition:
11
10
  transform 0.2s cubic-bezier(0.23, 1, 0.32, 1),
12
11
  opacity 0.2s cubic-bezier(0.23, 1, 0.32, 1);
13
12
  }
13
+
14
+ // 出场比入场快
15
+ &-leave-active {
16
+ transition:
17
+ transform 0.15s cubic-bezier(0.23, 1, 0.32, 1),
18
+ opacity 0.15s cubic-bezier(0.23, 1, 0.32, 1);
19
+ }
14
20
  }
15
21
 
16
22
  .slide-down {
@@ -2,7 +2,8 @@
2
2
  // 避免动画与拖拽内联样式互相覆盖、动画结束瞬间内联 transform 反扑导致跳帧
3
3
  @keyframes spring-in {
4
4
  0% {
5
- scale: 0;
5
+ scale: 0.9;
6
+ opacity: 0;
6
7
  }
7
8
  40% {
8
9
  scale: 1.1;
@@ -34,8 +35,26 @@
34
35
  }
35
36
 
36
37
  .spring-leave-to {
37
- scale: 0;
38
+ scale: 0.96;
38
39
  // 离开时归位到中心 (即便此前被拖拽过), 与原行为一致; !important 用于覆盖拖拽内联样式
39
40
  translate: 0 0 !important;
40
41
  opacity: 0;
41
42
  }
43
+
44
+ // 减弱动态效果:不缩放,只保留透明度
45
+ @media (prefers-reduced-motion: reduce) {
46
+ .spring-enter-active {
47
+ animation: none;
48
+ transition: opacity 0.2s ease;
49
+ }
50
+
51
+ .spring-leave-active {
52
+ transition-property: opacity;
53
+ }
54
+
55
+ .spring-enter-from,
56
+ .spring-leave-to {
57
+ scale: 1;
58
+ opacity: 0;
59
+ }
60
+ }
@@ -8,19 +8,25 @@
8
8
  opacity: 0;
9
9
  }
10
10
 
11
- &-enter-active,
12
- &-leave-active {
11
+ &-enter-active {
13
12
  transition:
14
13
  opacity 0.15s cubic-bezier(0.23, 1, 0.32, 1),
15
14
  transform 0.15s cubic-bezier(0.23, 1, 0.32, 1);
16
15
  }
16
+
17
+ // 出场比入场快
18
+ &-leave-active {
19
+ transition:
20
+ opacity 0.12s cubic-bezier(0.23, 1, 0.32, 1),
21
+ transform 0.12s cubic-bezier(0.23, 1, 0.32, 1);
22
+ }
17
23
  }
18
24
 
19
25
  .zoom-in-left,
20
26
  .zoom-in-right {
21
27
  &-enter-from,
22
28
  &-leave-to {
23
- transform: scaleX(0.8);
29
+ transform: scaleX(0.9);
24
30
  }
25
31
  }
26
32
 
@@ -28,14 +34,14 @@
28
34
  .zoom-in-bottom {
29
35
  &-enter-from,
30
36
  &-leave-to {
31
- transform: scaleY(0.8);
37
+ transform: scaleY(0.9);
32
38
  }
33
39
  }
34
40
 
35
41
  .zoom-in {
36
42
  &-enter-from,
37
43
  &-leave-to {
38
- transform: scale(0.8);
44
+ transform: scale(0.9);
39
45
  }
40
46
  }
41
47