@veltra/styles 1.14.1 → 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.
@@ -80,7 +80,7 @@ const lightTheme = new UITheme({
80
80
  normal: "0.25s",
81
81
  slow: "0.35s",
82
82
  ease: "cubic-bezier(0.4, 0, 0.2, 1)",
83
- easeOut: "cubic-bezier(0, 0, 0.2, 1)"
83
+ easeOut: "cubic-bezier(0.23, 1, 0.32, 1)"
84
84
  },
85
85
  gap: defineBySize({
86
86
  small: 6,
@@ -1 +1 @@
1
- {"version":3,"file":"light.js","names":[],"sources":["../../../src/theme/presets/light.ts"],"sourcesContent":["import { defineBySize } from '../helper'\nimport { UITheme } from '../ui-theme'\n\nexport const lightTheme: UITheme = new UITheme(\n {\n color: {\n primary: '#2563eb',\n success: '#16a34a',\n warning: '#d97706',\n danger: '#dc2626',\n info: '#0891b2',\n disabled: '#f4f4f5',\n default: '#f4f4f5'\n },\n\n bg: {\n color: {\n bottom: '#f4f4f5',\n middle: '#fafafa',\n top: '#ffffff',\n hover: '#f4f4f5',\n black: '#000000'\n },\n\n filter: { blur: 'none', saturate: 'none' }\n },\n\n // color 用于结构分隔线(保持安静);mutedColor 用于表单控件/卡片描边(需要清晰的 affordance)\n border: { color: '#e4e4e7', mutedColor: '#d4d4d8', width: 1, style: 'solid' },\n\n 'text-color': {\n title: '#18181b',\n main: '#3f3f46',\n placeholder: '#a1a1aa',\n second: '#71717a',\n assist: '#d4d4d8',\n disabled: '#a1a1aa',\n white: '#fff'\n },\n\n // 对齐 Tailwind rounded-md / rounded-lg / rounded-xl\n radius: defineBySize({ small: 6, default: 8, large: 12 }),\n\n 'form-component-height': defineBySize({ small: 24, default: 32, large: 40 }),\n\n 'font-family':\n 'system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", sans-serif',\n\n 'font-size-title': defineBySize({ small: 14, default: 16, large: 18 }),\n\n 'font-size-main': defineBySize({ small: 12, default: 14, large: 16 }),\n\n 'font-size-assist': defineBySize({ small: 12, default: 12, large: 14 }),\n\n shadow: {\n color: '#00000014',\n x: 0,\n y: 1,\n blur: 3,\n spread: 0,\n emboss: 'none',\n sm: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',\n lg: '0 8px 24px 0 rgba(0, 0, 0, 0.12), 0 2px 6px 0 rgba(0, 0, 0, 0.06)'\n },\n\n transition: {\n fast: '0.15s',\n normal: '0.25s',\n slow: '0.35s',\n ease: 'cubic-bezier(0.4, 0, 0.2, 1)',\n easeOut: 'cubic-bezier(0, 0, 0.2, 1)'\n },\n\n gap: defineBySize({ small: 6, default: 8, large: 12 }),\n\n breakpoint: { xs: 600, sm: 960, md: 1280, lg: 1920 },\n\n button: { 'default-bg': 'var(--u-bg-color-top)' }\n },\n { reactive: false }\n)\n"],"mappings":";;;AAGA,MAAa,aAAsB,IAAI,QACrC;CACE,OAAO;EACL,SAAS;EACT,SAAS;EACT,SAAS;EACT,QAAQ;EACR,MAAM;EACN,UAAU;EACV,SAAS;CACX;CAEA,IAAI;EACF,OAAO;GACL,QAAQ;GACR,QAAQ;GACR,KAAK;GACL,OAAO;GACP,OAAO;EACT;EAEA,QAAQ;GAAE,MAAM;GAAQ,UAAU;EAAO;CAC3C;CAGA,QAAQ;EAAE,OAAO;EAAW,YAAY;EAAW,OAAO;EAAG,OAAO;CAAQ;CAE5E,cAAc;EACZ,OAAO;EACP,MAAM;EACN,aAAa;EACb,QAAQ;EACR,QAAQ;EACR,UAAU;EACV,OAAO;CACT;CAGA,QAAQ,aAAa;EAAE,OAAO;EAAG,SAAS;EAAG,OAAO;CAAG,CAAC;CAExD,yBAAyB,aAAa;EAAE,OAAO;EAAI,SAAS;EAAI,OAAO;CAAG,CAAC;CAE3E,eACE;CAEF,mBAAmB,aAAa;EAAE,OAAO;EAAI,SAAS;EAAI,OAAO;CAAG,CAAC;CAErE,kBAAkB,aAAa;EAAE,OAAO;EAAI,SAAS;EAAI,OAAO;CAAG,CAAC;CAEpE,oBAAoB,aAAa;EAAE,OAAO;EAAI,SAAS;EAAI,OAAO;CAAG,CAAC;CAEtE,QAAQ;EACN,OAAO;EACP,GAAG;EACH,GAAG;EACH,MAAM;EACN,QAAQ;EACR,QAAQ;EACR,IAAI;EACJ,IAAI;CACN;CAEA,YAAY;EACV,MAAM;EACN,QAAQ;EACR,MAAM;EACN,MAAM;EACN,SAAS;CACX;CAEA,KAAK,aAAa;EAAE,OAAO;EAAG,SAAS;EAAG,OAAO;CAAG,CAAC;CAErD,YAAY;EAAE,IAAI;EAAK,IAAI;EAAK,IAAI;EAAM,IAAI;CAAK;CAEnD,QAAQ,EAAE,cAAc,wBAAwB;AAClD,GACA,EAAE,UAAU,MAAM,CACpB"}
1
+ {"version":3,"file":"light.js","names":[],"sources":["../../../src/theme/presets/light.ts"],"sourcesContent":["import { defineBySize } from '../helper'\nimport { UITheme } from '../ui-theme'\n\nexport const lightTheme: UITheme = new UITheme(\n {\n color: {\n primary: '#2563eb',\n success: '#16a34a',\n warning: '#d97706',\n danger: '#dc2626',\n info: '#0891b2',\n disabled: '#f4f4f5',\n default: '#f4f4f5'\n },\n\n bg: {\n color: {\n bottom: '#f4f4f5',\n middle: '#fafafa',\n top: '#ffffff',\n hover: '#f4f4f5',\n black: '#000000'\n },\n\n filter: { blur: 'none', saturate: 'none' }\n },\n\n // color 用于结构分隔线(保持安静);mutedColor 用于表单控件/卡片描边(需要清晰的 affordance)\n border: { color: '#e4e4e7', mutedColor: '#d4d4d8', width: 1, style: 'solid' },\n\n 'text-color': {\n title: '#18181b',\n main: '#3f3f46',\n placeholder: '#a1a1aa',\n second: '#71717a',\n assist: '#d4d4d8',\n disabled: '#a1a1aa',\n white: '#fff'\n },\n\n // 对齐 Tailwind rounded-md / rounded-lg / rounded-xl\n radius: defineBySize({ small: 6, default: 8, large: 12 }),\n\n 'form-component-height': defineBySize({ small: 24, default: 32, large: 40 }),\n\n 'font-family':\n 'system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", sans-serif',\n\n 'font-size-title': defineBySize({ small: 14, default: 16, large: 18 }),\n\n 'font-size-main': defineBySize({ small: 12, default: 14, large: 16 }),\n\n 'font-size-assist': defineBySize({ small: 12, default: 12, large: 14 }),\n\n shadow: {\n color: '#00000014',\n x: 0,\n y: 1,\n blur: 3,\n spread: 0,\n emboss: 'none',\n sm: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',\n lg: '0 8px 24px 0 rgba(0, 0, 0, 0.12), 0 2px 6px 0 rgba(0, 0, 0, 0.06)'\n },\n\n transition: {\n fast: '0.15s',\n normal: '0.25s',\n slow: '0.35s',\n ease: 'cubic-bezier(0.4, 0, 0.2, 1)',\n easeOut: 'cubic-bezier(0.23, 1, 0.32, 1)'\n },\n\n gap: defineBySize({ small: 6, default: 8, large: 12 }),\n\n breakpoint: { xs: 600, sm: 960, md: 1280, lg: 1920 },\n\n button: { 'default-bg': 'var(--u-bg-color-top)' }\n },\n { reactive: false }\n)\n"],"mappings":";;;AAGA,MAAa,aAAsB,IAAI,QACrC;CACE,OAAO;EACL,SAAS;EACT,SAAS;EACT,SAAS;EACT,QAAQ;EACR,MAAM;EACN,UAAU;EACV,SAAS;CACX;CAEA,IAAI;EACF,OAAO;GACL,QAAQ;GACR,QAAQ;GACR,KAAK;GACL,OAAO;GACP,OAAO;EACT;EAEA,QAAQ;GAAE,MAAM;GAAQ,UAAU;EAAO;CAC3C;CAGA,QAAQ;EAAE,OAAO;EAAW,YAAY;EAAW,OAAO;EAAG,OAAO;CAAQ;CAE5E,cAAc;EACZ,OAAO;EACP,MAAM;EACN,aAAa;EACb,QAAQ;EACR,QAAQ;EACR,UAAU;EACV,OAAO;CACT;CAGA,QAAQ,aAAa;EAAE,OAAO;EAAG,SAAS;EAAG,OAAO;CAAG,CAAC;CAExD,yBAAyB,aAAa;EAAE,OAAO;EAAI,SAAS;EAAI,OAAO;CAAG,CAAC;CAE3E,eACE;CAEF,mBAAmB,aAAa;EAAE,OAAO;EAAI,SAAS;EAAI,OAAO;CAAG,CAAC;CAErE,kBAAkB,aAAa;EAAE,OAAO;EAAI,SAAS;EAAI,OAAO;CAAG,CAAC;CAEpE,oBAAoB,aAAa;EAAE,OAAO;EAAI,SAAS;EAAI,OAAO;CAAG,CAAC;CAEtE,QAAQ;EACN,OAAO;EACP,GAAG;EACH,GAAG;EACH,MAAM;EACN,QAAQ;EACR,QAAQ;EACR,IAAI;EACJ,IAAI;CACN;CAEA,YAAY;EACV,MAAM;EACN,QAAQ;EACR,MAAM;EACN,MAAM;EACN,SAAS;CACX;CAEA,KAAK,aAAa;EAAE,OAAO;EAAG,SAAS;EAAG,OAAO;CAAG,CAAC;CAErD,YAAY;EAAE,IAAI;EAAK,IAAI;EAAK,IAAI;EAAM,IAAI;CAAK;CAEnD,QAAQ,EAAE,cAAc,wBAAwB;AAClD,GACA,EAAE,UAAU,MAAM,CACpB"}
@@ -1,19 +1,31 @@
1
1
  .fade-scale-enter-active {
2
2
  will-change: scale, opacity;
3
- transition: scale 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease;
3
+ transition: scale 200ms cubic-bezier(0.23, 1, 0.32, 1), opacity 200ms cubic-bezier(0.23, 1, 0.32, 1);
4
4
  }
5
5
 
6
6
  .fade-scale-leave-active {
7
7
  will-change: scale, opacity;
8
- transition: scale 0.2s ease-in, opacity 0.15s ease-in;
8
+ transition: scale 160ms cubic-bezier(0.23, 1, 0.32, 1), opacity 160ms cubic-bezier(0.23, 1, 0.32, 1);
9
9
  }
10
10
 
11
11
  .fade-scale-enter-from {
12
- scale: 0.8;
12
+ scale: 0.96;
13
13
  opacity: 0;
14
14
  }
15
15
 
16
16
  .fade-scale-leave-to {
17
- scale: 0.9;
17
+ scale: 0.98;
18
18
  opacity: 0;
19
19
  }
20
+
21
+ @media (prefers-reduced-motion: reduce) {
22
+ .fade-scale-enter-active,
23
+ .fade-scale-leave-active {
24
+ transition-property: opacity;
25
+ }
26
+ .fade-scale-enter-from,
27
+ .fade-scale-leave-to {
28
+ scale: 1;
29
+ opacity: 0;
30
+ }
31
+ }
@@ -4,23 +4,37 @@
4
4
  .fade-scale-enter-active {
5
5
  will-change: scale, opacity;
6
6
  transition:
7
- scale 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
8
- opacity 0.35s ease;
7
+ scale 200ms cubic-bezier(0.23, 1, 0.32, 1),
8
+ opacity 200ms cubic-bezier(0.23, 1, 0.32, 1);
9
9
  }
10
10
 
11
11
  .fade-scale-leave-active {
12
12
  will-change: scale, opacity;
13
13
  transition:
14
- scale 0.2s ease-in,
15
- opacity 0.15s ease-in;
14
+ scale 160ms cubic-bezier(0.23, 1, 0.32, 1),
15
+ opacity 160ms cubic-bezier(0.23, 1, 0.32, 1);
16
16
  }
17
17
 
18
18
  .fade-scale-enter-from {
19
- scale: 0.8;
19
+ scale: 0.96;
20
20
  opacity: 0;
21
21
  }
22
22
 
23
23
  .fade-scale-leave-to {
24
- scale: 0.9;
24
+ scale: 0.98;
25
25
  opacity: 0;
26
26
  }
27
+
28
+ // 减弱动态效果:不缩放,只保留透明度
29
+ @media (prefers-reduced-motion: reduce) {
30
+ .fade-scale-enter-active,
31
+ .fade-scale-leave-active {
32
+ transition-property: opacity;
33
+ }
34
+
35
+ .fade-scale-enter-from,
36
+ .fade-scale-leave-to {
37
+ scale: 1;
38
+ opacity: 0;
39
+ }
40
+ }
@@ -3,10 +3,13 @@
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,
6
+ .slide-down-enter-active,
7
+ .slide-up-enter-active {
8
+ transition: transform 0.2s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.2s cubic-bezier(0.23, 1, 0.32, 1);
9
+ }
10
+ .slide-down-leave-active,
8
11
  .slide-up-leave-active {
9
- transition: transform 0.2s cubic-bezier(0, 0, 0.2, 1), opacity 0.2s cubic-bezier(0, 0, 0.2, 1);
12
+ transition: transform 0.15s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.15s cubic-bezier(0.23, 1, 0.32, 1);
10
13
  }
11
14
 
12
15
  .slide-down-enter-from, .slide-down-leave-to {
@@ -16,3 +19,19 @@
16
19
  .slide-up-enter-from, .slide-up-leave-to {
17
20
  transform: translateY(10px);
18
21
  }
22
+
23
+ @media (prefers-reduced-motion: reduce) {
24
+ .slide-down-enter-active,
25
+ .slide-down-leave-active,
26
+ .slide-up-enter-active,
27
+ .slide-up-leave-active {
28
+ transition-property: opacity;
29
+ }
30
+ .slide-down-enter-from,
31
+ .slide-down-leave-to,
32
+ .slide-up-enter-from,
33
+ .slide-up-leave-to {
34
+ transform: none;
35
+ opacity: 0;
36
+ }
37
+ }
@@ -5,11 +5,17 @@
5
5
  opacity: 0;
6
6
  }
7
7
 
8
- &-enter-active,
8
+ &-enter-active {
9
+ transition:
10
+ transform 0.2s cubic-bezier(0.23, 1, 0.32, 1),
11
+ opacity 0.2s cubic-bezier(0.23, 1, 0.32, 1);
12
+ }
13
+
14
+ // 出场比入场快
9
15
  &-leave-active {
10
16
  transition:
11
- transform 0.2s cubic-bezier(0, 0, 0.2, 1),
12
- opacity 0.2s cubic-bezier(0, 0, 0.2, 1);
17
+ transform 0.15s cubic-bezier(0.23, 1, 0.32, 1),
18
+ opacity 0.15s cubic-bezier(0.23, 1, 0.32, 1);
13
19
  }
14
20
  }
15
21
 
@@ -26,3 +32,21 @@
26
32
  transform: translateY(10px);
27
33
  }
28
34
  }
35
+
36
+ // 减弱动态效果:不位移,只保留透明度
37
+ @media (prefers-reduced-motion: reduce) {
38
+ .slide-down-enter-active,
39
+ .slide-down-leave-active,
40
+ .slide-up-enter-active,
41
+ .slide-up-leave-active {
42
+ transition-property: opacity;
43
+ }
44
+
45
+ .slide-down-enter-from,
46
+ .slide-down-leave-to,
47
+ .slide-up-enter-from,
48
+ .slide-up-leave-to {
49
+ transform: none;
50
+ opacity: 0;
51
+ }
52
+ }
@@ -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
+ }
@@ -14,30 +14,30 @@
14
14
  .zoom-in-right-enter-active,
15
15
  .zoom-in-top-enter-active,
16
16
  .zoom-in-bottom-enter-active {
17
- transition: opacity 0.15s ease-in, transform 0.15s ease-in;
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
18
  }
19
19
  .zoom-in-leave-active,
20
20
  .zoom-in-left-leave-active,
21
21
  .zoom-in-right-leave-active,
22
22
  .zoom-in-top-leave-active,
23
23
  .zoom-in-bottom-leave-active {
24
- transition: opacity 0.15s ease-out, transform 0.15s ease-out;
24
+ transition: opacity 0.12s cubic-bezier(0.23, 1, 0.32, 1), transform 0.12s cubic-bezier(0.23, 1, 0.32, 1);
25
25
  }
26
26
 
27
27
  .zoom-in-left-enter-from, .zoom-in-left-leave-to,
28
28
  .zoom-in-right-enter-from,
29
29
  .zoom-in-right-leave-to {
30
- transform: scaleX(0.8);
30
+ transform: scaleX(0.9);
31
31
  }
32
32
 
33
33
  .zoom-in-top-enter-from, .zoom-in-top-leave-to,
34
34
  .zoom-in-bottom-enter-from,
35
35
  .zoom-in-bottom-leave-to {
36
- transform: scaleY(0.8);
36
+ transform: scaleY(0.9);
37
37
  }
38
38
 
39
39
  .zoom-in-enter-from, .zoom-in-leave-to {
40
- transform: scale(0.8);
40
+ transform: scale(0.9);
41
41
  }
42
42
 
43
43
  .zoom-in-left-enter-active, .zoom-in-left-leave-active {
@@ -55,3 +55,31 @@
55
55
  .zoom-in-bottom-enter-active, .zoom-in-bottom-leave-active {
56
56
  transform-origin: center bottom;
57
57
  }
58
+
59
+ @media (prefers-reduced-motion: reduce) {
60
+ .zoom-in-enter-active,
61
+ .zoom-in-leave-active,
62
+ .zoom-in-left-enter-active,
63
+ .zoom-in-left-leave-active,
64
+ .zoom-in-right-enter-active,
65
+ .zoom-in-right-leave-active,
66
+ .zoom-in-top-enter-active,
67
+ .zoom-in-top-leave-active,
68
+ .zoom-in-bottom-enter-active,
69
+ .zoom-in-bottom-leave-active {
70
+ transition-property: opacity;
71
+ }
72
+ .zoom-in-enter-from,
73
+ .zoom-in-leave-to,
74
+ .zoom-in-left-enter-from,
75
+ .zoom-in-left-leave-to,
76
+ .zoom-in-right-enter-from,
77
+ .zoom-in-right-leave-to,
78
+ .zoom-in-top-enter-from,
79
+ .zoom-in-top-leave-to,
80
+ .zoom-in-bottom-enter-from,
81
+ .zoom-in-bottom-leave-to {
82
+ transform: none;
83
+ opacity: 0;
84
+ }
85
+ }
@@ -10,14 +10,15 @@
10
10
 
11
11
  &-enter-active {
12
12
  transition:
13
- opacity 0.15s ease-in,
14
- transform 0.15s ease-in;
13
+ opacity 0.15s cubic-bezier(0.23, 1, 0.32, 1),
14
+ transform 0.15s cubic-bezier(0.23, 1, 0.32, 1);
15
15
  }
16
16
 
17
+ // 出场比入场快
17
18
  &-leave-active {
18
19
  transition:
19
- opacity 0.15s ease-out,
20
- transform 0.15s ease-out;
20
+ opacity 0.12s cubic-bezier(0.23, 1, 0.32, 1),
21
+ transform 0.12s cubic-bezier(0.23, 1, 0.32, 1);
21
22
  }
22
23
  }
23
24
 
@@ -25,7 +26,7 @@
25
26
  .zoom-in-right {
26
27
  &-enter-from,
27
28
  &-leave-to {
28
- transform: scaleX(0.8);
29
+ transform: scaleX(0.9);
29
30
  }
30
31
  }
31
32
 
@@ -33,14 +34,14 @@
33
34
  .zoom-in-bottom {
34
35
  &-enter-from,
35
36
  &-leave-to {
36
- transform: scaleY(0.8);
37
+ transform: scaleY(0.9);
37
38
  }
38
39
  }
39
40
 
40
41
  .zoom-in {
41
42
  &-enter-from,
42
43
  &-leave-to {
43
- transform: scale(0.8);
44
+ transform: scale(0.9);
44
45
  }
45
46
  }
46
47
 
@@ -71,3 +72,33 @@
71
72
  transform-origin: center bottom;
72
73
  }
73
74
  }
75
+
76
+ // 减弱动态效果:不缩放,只保留透明度
77
+ @media (prefers-reduced-motion: reduce) {
78
+ .zoom-in-enter-active,
79
+ .zoom-in-leave-active,
80
+ .zoom-in-left-enter-active,
81
+ .zoom-in-left-leave-active,
82
+ .zoom-in-right-enter-active,
83
+ .zoom-in-right-leave-active,
84
+ .zoom-in-top-enter-active,
85
+ .zoom-in-top-leave-active,
86
+ .zoom-in-bottom-enter-active,
87
+ .zoom-in-bottom-leave-active {
88
+ transition-property: opacity;
89
+ }
90
+
91
+ .zoom-in-enter-from,
92
+ .zoom-in-leave-to,
93
+ .zoom-in-left-enter-from,
94
+ .zoom-in-left-leave-to,
95
+ .zoom-in-right-enter-from,
96
+ .zoom-in-right-leave-to,
97
+ .zoom-in-top-enter-from,
98
+ .zoom-in-top-leave-to,
99
+ .zoom-in-bottom-enter-from,
100
+ .zoom-in-bottom-leave-to {
101
+ transform: none;
102
+ opacity: 0;
103
+ }
104
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veltra/styles",
3
- "version": "1.14.1",
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"
@@ -68,7 +68,7 @@ export const lightTheme: UITheme = new UITheme(
68
68
  normal: '0.25s',
69
69
  slow: '0.35s',
70
70
  ease: 'cubic-bezier(0.4, 0, 0.2, 1)',
71
- easeOut: 'cubic-bezier(0, 0, 0.2, 1)'
71
+ easeOut: 'cubic-bezier(0.23, 1, 0.32, 1)'
72
72
  },
73
73
 
74
74
  gap: defineBySize({ small: 6, default: 8, large: 12 }),
@@ -4,23 +4,37 @@
4
4
  .fade-scale-enter-active {
5
5
  will-change: scale, opacity;
6
6
  transition:
7
- scale 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
8
- opacity 0.35s ease;
7
+ scale 200ms cubic-bezier(0.23, 1, 0.32, 1),
8
+ opacity 200ms cubic-bezier(0.23, 1, 0.32, 1);
9
9
  }
10
10
 
11
11
  .fade-scale-leave-active {
12
12
  will-change: scale, opacity;
13
13
  transition:
14
- scale 0.2s ease-in,
15
- opacity 0.15s ease-in;
14
+ scale 160ms cubic-bezier(0.23, 1, 0.32, 1),
15
+ opacity 160ms cubic-bezier(0.23, 1, 0.32, 1);
16
16
  }
17
17
 
18
18
  .fade-scale-enter-from {
19
- scale: 0.8;
19
+ scale: 0.96;
20
20
  opacity: 0;
21
21
  }
22
22
 
23
23
  .fade-scale-leave-to {
24
- scale: 0.9;
24
+ scale: 0.98;
25
25
  opacity: 0;
26
26
  }
27
+
28
+ // 减弱动态效果:不缩放,只保留透明度
29
+ @media (prefers-reduced-motion: reduce) {
30
+ .fade-scale-enter-active,
31
+ .fade-scale-leave-active {
32
+ transition-property: opacity;
33
+ }
34
+
35
+ .fade-scale-enter-from,
36
+ .fade-scale-leave-to {
37
+ scale: 1;
38
+ opacity: 0;
39
+ }
40
+ }
@@ -5,11 +5,17 @@
5
5
  opacity: 0;
6
6
  }
7
7
 
8
- &-enter-active,
8
+ &-enter-active {
9
+ transition:
10
+ transform 0.2s cubic-bezier(0.23, 1, 0.32, 1),
11
+ opacity 0.2s cubic-bezier(0.23, 1, 0.32, 1);
12
+ }
13
+
14
+ // 出场比入场快
9
15
  &-leave-active {
10
16
  transition:
11
- transform 0.2s cubic-bezier(0, 0, 0.2, 1),
12
- opacity 0.2s cubic-bezier(0, 0, 0.2, 1);
17
+ transform 0.15s cubic-bezier(0.23, 1, 0.32, 1),
18
+ opacity 0.15s cubic-bezier(0.23, 1, 0.32, 1);
13
19
  }
14
20
  }
15
21
 
@@ -26,3 +32,21 @@
26
32
  transform: translateY(10px);
27
33
  }
28
34
  }
35
+
36
+ // 减弱动态效果:不位移,只保留透明度
37
+ @media (prefers-reduced-motion: reduce) {
38
+ .slide-down-enter-active,
39
+ .slide-down-leave-active,
40
+ .slide-up-enter-active,
41
+ .slide-up-leave-active {
42
+ transition-property: opacity;
43
+ }
44
+
45
+ .slide-down-enter-from,
46
+ .slide-down-leave-to,
47
+ .slide-up-enter-from,
48
+ .slide-up-leave-to {
49
+ transform: none;
50
+ opacity: 0;
51
+ }
52
+ }
@@ -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
+ }
@@ -10,14 +10,15 @@
10
10
 
11
11
  &-enter-active {
12
12
  transition:
13
- opacity 0.15s ease-in,
14
- transform 0.15s ease-in;
13
+ opacity 0.15s cubic-bezier(0.23, 1, 0.32, 1),
14
+ transform 0.15s cubic-bezier(0.23, 1, 0.32, 1);
15
15
  }
16
16
 
17
+ // 出场比入场快
17
18
  &-leave-active {
18
19
  transition:
19
- opacity 0.15s ease-out,
20
- transform 0.15s ease-out;
20
+ opacity 0.12s cubic-bezier(0.23, 1, 0.32, 1),
21
+ transform 0.12s cubic-bezier(0.23, 1, 0.32, 1);
21
22
  }
22
23
  }
23
24
 
@@ -25,7 +26,7 @@
25
26
  .zoom-in-right {
26
27
  &-enter-from,
27
28
  &-leave-to {
28
- transform: scaleX(0.8);
29
+ transform: scaleX(0.9);
29
30
  }
30
31
  }
31
32
 
@@ -33,14 +34,14 @@
33
34
  .zoom-in-bottom {
34
35
  &-enter-from,
35
36
  &-leave-to {
36
- transform: scaleY(0.8);
37
+ transform: scaleY(0.9);
37
38
  }
38
39
  }
39
40
 
40
41
  .zoom-in {
41
42
  &-enter-from,
42
43
  &-leave-to {
43
- transform: scale(0.8);
44
+ transform: scale(0.9);
44
45
  }
45
46
  }
46
47
 
@@ -71,3 +72,33 @@
71
72
  transform-origin: center bottom;
72
73
  }
73
74
  }
75
+
76
+ // 减弱动态效果:不缩放,只保留透明度
77
+ @media (prefers-reduced-motion: reduce) {
78
+ .zoom-in-enter-active,
79
+ .zoom-in-leave-active,
80
+ .zoom-in-left-enter-active,
81
+ .zoom-in-left-leave-active,
82
+ .zoom-in-right-enter-active,
83
+ .zoom-in-right-leave-active,
84
+ .zoom-in-top-enter-active,
85
+ .zoom-in-top-leave-active,
86
+ .zoom-in-bottom-enter-active,
87
+ .zoom-in-bottom-leave-active {
88
+ transition-property: opacity;
89
+ }
90
+
91
+ .zoom-in-enter-from,
92
+ .zoom-in-leave-to,
93
+ .zoom-in-left-enter-from,
94
+ .zoom-in-left-leave-to,
95
+ .zoom-in-right-enter-from,
96
+ .zoom-in-right-leave-to,
97
+ .zoom-in-top-enter-from,
98
+ .zoom-in-top-leave-to,
99
+ .zoom-in-bottom-enter-from,
100
+ .zoom-in-bottom-leave-to {
101
+ transform: none;
102
+ opacity: 0;
103
+ }
104
+ }