@neatui/css 4.8.0 → 4.8.2

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.
@@ -64,40 +64,60 @@ $card_a_sz: 'xs', 's', 'm', 'l', 'xl';
64
64
  [ui-card-tool] {
65
65
  & {
66
66
  position: relative;
67
+ // height: auto 精确等于内容高度,这里裁不到任何东西
67
68
  overflow: hidden;
69
+ // overflow 非 visible 会让 flex 自动最小尺寸归零。卡片被约束高度时
70
+ // (如 .full + 长表格),工具栏会被挤压到比内容还矮而被裁掉,必须禁止收缩
71
+ flex-shrink: 0;
72
+ // 让 height: auto 可以参与过渡,动画终点即真实内容高度
73
+ interpolate-size: allow-keywords;
68
74
  pointer-events: auto;
69
- max-height: 20em;
75
+ height: auto;
70
76
  opacity: 1;
71
77
  z-index: 2;
72
78
  transition:
73
- max-height 0.3s ease,
74
- padding 0.3s ease,
75
- margin 0.3s ease,
76
- opacity 0.2s ease 0.1s;
79
+ height 0.28s cubic-bezier(0.22, 0.61, 0.36, 1),
80
+ padding 0.28s cubic-bezier(0.22, 0.61, 0.36, 1),
81
+ margin 0.28s ease-out,
82
+ opacity 0.18s ease;
77
83
  background: var(--co-fore-o-lm);
78
84
  padding: 1em 1.5em;
79
85
  margin-bottom: 1px;
80
86
  }
81
87
 
88
+ // interpolate-size 会继承,把子元素还原成初始值,避免影响使用方自己的过渡
89
+ & > * {
90
+ interpolate-size: numeric-only;
91
+ }
92
+
82
93
  &[ui-card-tool~='hide'] {
83
94
  pointer-events: none;
84
95
  padding-top: 0 !important;
85
96
  padding-bottom: 0 !important;
86
97
  margin-bottom: 0 !important;
87
- max-height: 0 !important;
98
+ height: 0 !important;
88
99
  opacity: 0;
89
100
  transition:
90
- max-height 0.3s ease,
91
- padding 0.3s ease,
92
- margin 0.3s ease,
93
- opacity 0.15s ease;
101
+ height 0.26s cubic-bezier(0.4, 0, 0.2, 1),
102
+ padding 0.26s cubic-bezier(0.4, 0, 0.2, 1),
103
+ margin 0.26s ease,
104
+ opacity 0.14s ease;
94
105
  }
95
106
 
96
- // 支持 interpolate-size 的浏览器直接过渡到真实高度
97
- @supports (interpolate-size: allow-keywords) {
107
+ // 不支持 interpolate-size 的浏览器(Firefox):高度直接开合,不做动画,同样不裁剪
108
+ @supports not (interpolate-size: allow-keywords) {
98
109
  & {
99
- interpolate-size: allow-keywords;
100
- max-height: max-content;
110
+ transition:
111
+ padding 0.28s ease-out,
112
+ margin 0.28s ease-out,
113
+ opacity 0.18s ease;
114
+ }
115
+
116
+ &[ui-card-tool~='hide'] {
117
+ transition:
118
+ padding 0.26s ease,
119
+ margin 0.26s ease,
120
+ opacity 0.14s ease;
101
121
  }
102
122
  }
103
123
  }
package/dist/neatui.css CHANGED
@@ -21411,30 +21411,37 @@ body [ui-btn~="@b"][ui-btn~=b][ui-btn~=":underline"]:hover{
21411
21411
  justify-content:flex-end;
21412
21412
  }
21413
21413
  [ui-card~="@a"] [ui-card-tool]{
21414
+ flex-shrink:0;
21415
+ overflow:hidden;
21416
+ position:relative;
21417
+ interpolate-size:allow-keywords;
21414
21418
  background:var(--co-fore-o-lm);
21419
+ height:auto;
21415
21420
  margin-bottom:1px;
21416
- max-height:20em;
21417
21421
  opacity:1;
21418
- overflow:hidden;
21419
21422
  padding:1em 1.5em;
21420
21423
  pointer-events:auto;
21421
- position:relative;
21422
- transition:max-height .3s ease,padding .3s ease,margin .3s ease,opacity .2s ease .1s;
21424
+ transition:height .28s cubic-bezier(.22, .61, .36, 1),padding .28s cubic-bezier(.22, .61, .36, 1),margin .28s ease-out,opacity .18s ease;
21423
21425
  z-index:2;
21424
21426
  }
21427
+ [ui-card~="@a"] [ui-card-tool]>*{
21428
+ interpolate-size:numeric-only;
21429
+ }
21425
21430
  [ui-card~="@a"] [ui-card-tool][ui-card-tool~=hide]{
21431
+ height:0 !important;
21426
21432
  margin-bottom:0 !important;
21427
- max-height:0 !important;
21428
21433
  opacity:0;
21429
21434
  padding-bottom:0 !important;
21430
21435
  padding-top:0 !important;
21431
21436
  pointer-events:none;
21432
- transition:max-height .3s ease,padding .3s ease,margin .3s ease,opacity .15s ease;
21437
+ transition:height .26s cubic-bezier(.4, 0, .2, 1),padding .26s cubic-bezier(.4, 0, .2, 1),margin .26s ease,opacity .14s ease;
21433
21438
  }
21434
- @supports (interpolate-size:allow-keywords){
21439
+ @supports not (interpolate-size:allow-keywords){
21435
21440
  [ui-card~="@a"] [ui-card-tool]{
21436
- interpolate-size:allow-keywords;
21437
- max-height:max-content;
21441
+ transition:padding .28s ease-out,margin .28s ease-out,opacity .18s ease;
21442
+ }
21443
+ [ui-card~="@a"] [ui-card-tool][ui-card-tool~=hide]{
21444
+ transition:padding .26s ease,margin .26s ease,opacity .14s ease;
21438
21445
  }
21439
21446
  }
21440
21447
  [ui-card~="@a"] [ui-card-body]{
@@ -21699,30 +21706,37 @@ body [ui-btn~="@b"][ui-btn~=b][ui-btn~=":underline"]:hover{
21699
21706
  justify-content:flex-end;
21700
21707
  }
21701
21708
  [ui-cards~="@a"]>*>* [ui-card-tool]{
21709
+ flex-shrink:0;
21710
+ overflow:hidden;
21711
+ position:relative;
21712
+ interpolate-size:allow-keywords;
21702
21713
  background:var(--co-fore-o-lm);
21714
+ height:auto;
21703
21715
  margin-bottom:1px;
21704
- max-height:20em;
21705
21716
  opacity:1;
21706
- overflow:hidden;
21707
21717
  padding:1em 1.5em;
21708
21718
  pointer-events:auto;
21709
- position:relative;
21710
- transition:max-height .3s ease,padding .3s ease,margin .3s ease,opacity .2s ease .1s;
21719
+ transition:height .28s cubic-bezier(.22, .61, .36, 1),padding .28s cubic-bezier(.22, .61, .36, 1),margin .28s ease-out,opacity .18s ease;
21711
21720
  z-index:2;
21712
21721
  }
21722
+ [ui-cards~="@a"]>*>* [ui-card-tool]>*{
21723
+ interpolate-size:numeric-only;
21724
+ }
21713
21725
  [ui-cards~="@a"]>*>* [ui-card-tool][ui-card-tool~=hide]{
21726
+ height:0 !important;
21714
21727
  margin-bottom:0 !important;
21715
- max-height:0 !important;
21716
21728
  opacity:0;
21717
21729
  padding-bottom:0 !important;
21718
21730
  padding-top:0 !important;
21719
21731
  pointer-events:none;
21720
- transition:max-height .3s ease,padding .3s ease,margin .3s ease,opacity .15s ease;
21732
+ transition:height .26s cubic-bezier(.4, 0, .2, 1),padding .26s cubic-bezier(.4, 0, .2, 1),margin .26s ease,opacity .14s ease;
21721
21733
  }
21722
- @supports (interpolate-size:allow-keywords){
21734
+ @supports not (interpolate-size:allow-keywords){
21723
21735
  [ui-cards~="@a"]>*>* [ui-card-tool]{
21724
- interpolate-size:allow-keywords;
21725
- max-height:max-content;
21736
+ transition:padding .28s ease-out,margin .28s ease-out,opacity .18s ease;
21737
+ }
21738
+ [ui-cards~="@a"]>*>* [ui-card-tool][ui-card-tool~=hide]{
21739
+ transition:padding .26s ease,margin .26s ease,opacity .14s ease;
21726
21740
  }
21727
21741
  }
21728
21742
  [ui-cards~="@a"]>*>* [ui-card-body]{