Browse Source

💄 style: hide announcement modal scrollbar

Improve UX by hiding the vertical scrollbar inside the announcement (NoticeModal)
while keeping the content scrollable.

Changes
• NoticeModal.js
  - Introduce `notice-content-scroll` class to the content wrapper.
  - Remove inline custom scrollbar styling for cleaner code.

• index.css
  - Add `.notice-content-scroll` to the global hidden-scrollbar rules, ensuring
    scrollbars are hidden across browsers.

Result
Users can still scroll through long announcements, but no scrollbar is shown,
giving the modal a cleaner and more consistent appearance.
Apple\Apple 7 months ago
parent
commit
d2b47969da
2 changed files with 12 additions and 14 deletions
  1. 1 5
      web/src/components/layout/NoticeModal.js
  2. 11 9
      web/src/index.css

+ 1 - 5
web/src/components/layout/NoticeModal.js

@@ -64,11 +64,7 @@ const NoticeModal = ({ visible, onClose, isMobile }) => {
     return (
       <div
         dangerouslySetInnerHTML={{ __html: noticeContent }}
-        className="max-h-[60vh] overflow-y-auto pr-2"
-        style={{
-          scrollbarWidth: 'thin',
-          scrollbarColor: 'var(--semi-color-tertiary) transparent'
-        }}
+        className="notice-content-scroll max-h-[60vh] overflow-y-auto pr-2"
       />
     );
   };

+ 11 - 9
web/src/index.css

@@ -375,23 +375,25 @@ code {
 }
 
 /* 隐藏卡片内容区域的滚动条 */
-.card-content-scroll::-webkit-scrollbar,
-.model-settings-scroll::-webkit-scrollbar,
-.thinking-content-scroll::-webkit-scrollbar,
-.custom-request-textarea .semi-input::-webkit-scrollbar,
-.custom-request-textarea textarea::-webkit-scrollbar {
-  display: none;
-}
-
 .card-content-scroll,
 .model-settings-scroll,
 .thinking-content-scroll,
 .custom-request-textarea .semi-input,
-.custom-request-textarea textarea {
+.custom-request-textarea textarea,
+.notice-content-scroll {
   -ms-overflow-style: none;
   scrollbar-width: none;
 }
 
+.card-content-scroll::-webkit-scrollbar,
+.model-settings-scroll::-webkit-scrollbar,
+.thinking-content-scroll::-webkit-scrollbar,
+.custom-request-textarea .semi-input::-webkit-scrollbar,
+.custom-request-textarea textarea::-webkit-scrollbar,
+.notice-content-scroll::-webkit-scrollbar {
+  display: none;
+}
+
 /* 图片列表滚动条样式 */
 .image-list-scroll::-webkit-scrollbar {
   width: 6px;