SarahXia0405 commited on
Commit
ca9e2d0
·
verified ·
1 Parent(s): 20499bc

Update web/src/styles/globals.css

Browse files
Files changed (1) hide show
  1. web/src/styles/globals.css +93 -3
web/src/styles/globals.css CHANGED
@@ -1,3 +1,5 @@
 
 
1
  @custom-variant dark (&:is(.dark *));
2
 
3
  :root {
@@ -134,7 +136,7 @@
134
  @apply bg-background text-foreground;
135
  -webkit-font-smoothing: antialiased;
136
  -moz-osx-font-smoothing: grayscale;
137
- overflow: hidden; /* 禁用页面滚动,避免左右中面板滚动联动(scroll chaining) */
138
  }
139
  }
140
 
@@ -142,7 +144,7 @@
142
  * Base typography. This is not applied to elements which have an ancestor with a Tailwind text class.
143
  */
144
  @layer base {
145
- :where(:not(:has([class*=' text-']), :not(:has([class^='text-'])))) {
146
  h1 {
147
  font-size: var(--text-2xl);
148
  font-weight: var(--font-weight-medium);
@@ -189,4 +191,92 @@
189
 
190
  html {
191
  font-size: var(--font-size);
192
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* web/src/styles/globals.css */
2
+
3
  @custom-variant dark (&:is(.dark *));
4
 
5
  :root {
 
136
  @apply bg-background text-foreground;
137
  -webkit-font-smoothing: antialiased;
138
  -moz-osx-font-smoothing: grayscale;
139
+ overflow: hidden; /* 禁用页面滚动:滚动只发生在 panelScroll/chatScroll */
140
  }
141
  }
142
 
 
144
  * Base typography. This is not applied to elements which have an ancestor with a Tailwind text class.
145
  */
146
  @layer base {
147
+ :where(:not(:has([class*=" text-"]), :not(:has([class^="text-"])))) {
148
  h1 {
149
  font-size: var(--text-2xl);
150
  font-weight: var(--font-weight-medium);
 
191
 
192
  html {
193
  font-size: var(--font-size);
194
+ }
195
+
196
+ /* =========================================================
197
+ ✅ NEW: 分区滚动基础设施(全局统一)
198
+ ========================================================= */
199
+
200
+ /* 1) 三列/整体布局骨架:父容器必须 min-height:0 才能允许子元素滚动 */
201
+ .appShell {
202
+ height: 100vh;
203
+ overflow: hidden;
204
+ display: flex;
205
+ min-height: 0;
206
+ }
207
+
208
+ /* 每列容器:自身不滚,只允许内部滚动容器滚 */
209
+ .col {
210
+ height: 100%;
211
+ min-height: 0;
212
+ overflow: hidden;
213
+ display: flex;
214
+ flex-direction: column;
215
+ }
216
+
217
+ /* 固定区:比如顶部栏、标题栏 */
218
+ .colFixed {
219
+ flex: 0 0 auto;
220
+ }
221
+
222
+ /* 弹性区:通常里面放 panelScroll/chatScroll */
223
+ .colFlex {
224
+ flex: 1 1 auto;
225
+ min-height: 0;
226
+ overflow: hidden;
227
+ }
228
+
229
+ /* 2) 侧边栏/面板通用滚动容器 */
230
+ .panelScroll {
231
+ overflow-y: auto;
232
+ overflow-x: hidden;
233
+ min-height: 0;
234
+ padding-right: 10px;
235
+
236
+ /* 关键:阻断滚动链,避免滚到底把外层一起带着滚 */
237
+ overscroll-behavior: contain;
238
+
239
+ /* iOS/移动端更顺 */
240
+ -webkit-overflow-scrolling: touch;
241
+ }
242
+
243
+ /* 3) Chat 消息区专用滚动容器(建议只让它滚) */
244
+ .chatScroll {
245
+ overflow-y: auto;
246
+ overflow-x: hidden;
247
+ min-height: 0;
248
+
249
+ overscroll-behavior: contain;
250
+ -webkit-overflow-scrolling: touch;
251
+ }
252
+
253
+ /* 4) 统一滚动条样式(Chrome/Safari) */
254
+ .panelScroll::-webkit-scrollbar,
255
+ .chatScroll::-webkit-scrollbar {
256
+ width: 10px;
257
+ }
258
+
259
+ .panelScroll::-webkit-scrollbar-thumb,
260
+ .chatScroll::-webkit-scrollbar-thumb {
261
+ background: rgba(0, 0, 0, 0.18);
262
+ border-radius: 999px;
263
+ border: 2px solid transparent;
264
+ background-clip: padding-box;
265
+ }
266
+
267
+ .panelScroll::-webkit-scrollbar-track,
268
+ .chatScroll::-webkit-scrollbar-track {
269
+ background: transparent;
270
+ }
271
+
272
+ /* Firefox scrollbar */
273
+ .panelScroll,
274
+ .chatScroll {
275
+ scrollbar-width: thin;
276
+ scrollbar-color: rgba(0, 0, 0, 0.25) transparent;
277
+ }
278
+
279
+ /* 5) 可选:强制禁止滚动(排查时很好用) */
280
+ .noScroll {
281
+ overflow: hidden !important;
282
+ }