@douyinfe/semi-foundation 2.99.0 → 2.99.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.
@@ -41,7 +41,7 @@
41
41
  }
42
42
  .semi-modal-wrap-center {
43
43
  display: flex;
44
- align-items: center;
44
+ align-items: flex-start;
45
45
  }
46
46
  .semi-modal-title {
47
47
  display: inline-flex;
@@ -152,7 +152,7 @@
152
152
  }
153
153
 
154
154
  .semi-modal-centered {
155
- margin: 0 auto;
155
+ margin: auto;
156
156
  }
157
157
 
158
158
  .semi-modal-popup .semi-modal-mask,
@@ -46,7 +46,14 @@ $module: #{$prefix}-modal;
46
46
  outline: 0;
47
47
  &-center{
48
48
  display: flex;
49
- align-items: center;
49
+ // Use flex-start + auto margin instead of `align-items: center`.
50
+ // When content fits the viewport, `margin: auto` on the modal
51
+ // centers it vertically. When content exceeds the viewport, auto
52
+ // margins collapse to 0 per the flexbox spec, so the modal aligns
53
+ // to the top of the wrap and the wrap's `overflow: auto` can scroll
54
+ // to both the top and the bottom of the modal. This prevents the
55
+ // "centered modal becomes unreachable" bug when content overflows.
56
+ align-items: flex-start;
50
57
  }
51
58
  }
52
59
 
@@ -194,7 +201,10 @@ $module: #{$prefix}-modal;
194
201
  }
195
202
 
196
203
  .#{$module}-centered {
197
- margin: 0 auto;
204
+ // `margin: auto` (instead of `0 auto`) lets the wrap's `display: flex;
205
+ // align-items: flex-start` produce visual vertical centering when content
206
+ // fits, while degrading to top-aligned + scrollable when content overflows.
207
+ margin: auto;
198
208
  }
199
209
 
200
210
  .#{$module}-popup {
@@ -41,7 +41,7 @@
41
41
  }
42
42
  .semi-modal-wrap-center {
43
43
  display: flex;
44
- align-items: center;
44
+ align-items: flex-start;
45
45
  }
46
46
  .semi-modal-title {
47
47
  display: inline-flex;
@@ -152,7 +152,7 @@
152
152
  }
153
153
 
154
154
  .semi-modal-centered {
155
- margin: 0 auto;
155
+ margin: auto;
156
156
  }
157
157
 
158
158
  .semi-modal-popup .semi-modal-mask,
@@ -46,7 +46,14 @@ $module: #{$prefix}-modal;
46
46
  outline: 0;
47
47
  &-center{
48
48
  display: flex;
49
- align-items: center;
49
+ // Use flex-start + auto margin instead of `align-items: center`.
50
+ // When content fits the viewport, `margin: auto` on the modal
51
+ // centers it vertically. When content exceeds the viewport, auto
52
+ // margins collapse to 0 per the flexbox spec, so the modal aligns
53
+ // to the top of the wrap and the wrap's `overflow: auto` can scroll
54
+ // to both the top and the bottom of the modal. This prevents the
55
+ // "centered modal becomes unreachable" bug when content overflows.
56
+ align-items: flex-start;
50
57
  }
51
58
  }
52
59
 
@@ -194,7 +201,10 @@ $module: #{$prefix}-modal;
194
201
  }
195
202
 
196
203
  .#{$module}-centered {
197
- margin: 0 auto;
204
+ // `margin: auto` (instead of `0 auto`) lets the wrap's `display: flex;
205
+ // align-items: flex-start` produce visual vertical centering when content
206
+ // fits, while degrading to top-aligned + scrollable when content overflows.
207
+ margin: auto;
198
208
  }
199
209
 
200
210
  .#{$module}-popup {
package/modal/modal.scss CHANGED
@@ -46,7 +46,14 @@ $module: #{$prefix}-modal;
46
46
  outline: 0;
47
47
  &-center{
48
48
  display: flex;
49
- align-items: center;
49
+ // Use flex-start + auto margin instead of `align-items: center`.
50
+ // When content fits the viewport, `margin: auto` on the modal
51
+ // centers it vertically. When content exceeds the viewport, auto
52
+ // margins collapse to 0 per the flexbox spec, so the modal aligns
53
+ // to the top of the wrap and the wrap's `overflow: auto` can scroll
54
+ // to both the top and the bottom of the modal. This prevents the
55
+ // "centered modal becomes unreachable" bug when content overflows.
56
+ align-items: flex-start;
50
57
  }
51
58
  }
52
59
 
@@ -194,7 +201,10 @@ $module: #{$prefix}-modal;
194
201
  }
195
202
 
196
203
  .#{$module}-centered {
197
- margin: 0 auto;
204
+ // `margin: auto` (instead of `0 auto`) lets the wrap's `display: flex;
205
+ // align-items: flex-start` produce visual vertical centering when content
206
+ // fits, while degrading to top-aligned + scrollable when content overflows.
207
+ margin: auto;
198
208
  }
199
209
 
200
210
  .#{$module}-popup {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-foundation",
3
- "version": "2.99.0",
3
+ "version": "2.99.1",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "clean": "rimraf lib",
@@ -14225,8 +14225,8 @@
14225
14225
  }
14226
14226
  },
14227
14227
  "dependencies": {
14228
- "@douyinfe/semi-animation": "2.99.0",
14229
- "@douyinfe/semi-json-viewer-core": "2.99.0",
14228
+ "@douyinfe/semi-animation": "2.99.1",
14229
+ "@douyinfe/semi-json-viewer-core": "2.99.1",
14230
14230
  "@mdx-js/mdx": "^3.0.1",
14231
14231
  "async-validator": "^3.5.0",
14232
14232
  "classnames": "^2.2.6",
@@ -14247,7 +14247,7 @@
14247
14247
  "*.scss",
14248
14248
  "*.css"
14249
14249
  ],
14250
- "gitHead": "c62861b574b51ae39afe7da796ab4f14d1462ef2",
14250
+ "gitHead": "18031e63923290207dd08bb6c476accea3e0116c",
14251
14251
  "devDependencies": {
14252
14252
  "@babel/plugin-transform-runtime": "^7.15.8",
14253
14253
  "@babel/preset-env": "^7.15.8",