Răsfoiți Sursa

fix: compatible with styles in dark mode

dragooncjw 10 luni în urmă
părinte
comite
7f3a4a9e48

+ 1 - 1
apps/demo-free-layout-simple/src/index.css

@@ -52,7 +52,7 @@
     padding: 12px 16px 0;
     box-sizing: border-box;
     background: #f7f7fa;
-    border-right: 1px solid rgba(29, 28, 35, 0.08));
+    border-right: 1px solid rgba(29, 28, 35, 0.08);
 }
 
 .demo-free-right-top-panel {

+ 15 - 0
apps/docs/global.less

@@ -62,3 +62,18 @@
 .rs-red {
   color: var(--rp-container-danger-text);
 }
+
+.light-mode {
+  color-scheme: light;
+  --background-color: #ffffff !important; /* 强制使用浅色背景 */
+  --text-color: #000000 !important; /* 强制使用深色文本 */
+  --rp-c-bg: #fff !important;
+
+  button {
+    background: transparent;
+  }
+}
+
+.light-mode * {
+  color: var(--text-color) !important;
+}

+ 3 - 1
apps/docs/src/en/examples/fixed-layout/fixed-feature-overview.mdx

@@ -7,7 +7,9 @@ outline: false
 
 import { FixedFeatureOverview } from '../../../../components';
 
-<FixedFeatureOverview />
+<div className='light-mode'>
+  <FixedFeatureOverview />
+</div>
 
 ## Installation
 

+ 3 - 1
apps/docs/src/en/examples/fixed-layout/fixed-layout-simple.mdx

@@ -7,7 +7,9 @@ outline: false
 
 import { FixedLayoutSimplePreview } from '../../../../components';
 
-<FixedLayoutSimplePreview />
+<div className='light-mode'>
+  <FixedLayoutSimplePreview />
+</div>
 
 ## Installation
 

+ 3 - 1
apps/docs/src/en/examples/free-layout/free-feature-overview.mdx

@@ -7,7 +7,9 @@ outline: false
 
 import { FreeFeatureOverview } from '../../../../components';
 
-<FreeFeatureOverview />
+<div className='light-mode'>
+  <FreeFeatureOverview />
+</div>
 
 ## Installation
 

+ 3 - 1
apps/docs/src/en/examples/free-layout/free-layout-simple.mdx

@@ -7,7 +7,9 @@ outline: false
 
 import { FreeLayoutSimplePreview } from '../../../../components';
 
-<FreeLayoutSimplePreview />
+<div className='light-mode'>
+  <FreeLayoutSimplePreview />
+</div>
 
 ## Installation
 

+ 3 - 1
apps/docs/src/zh/examples/fixed-layout/fixed-feature-overview.mdx

@@ -7,7 +7,9 @@ outline: false
 
 import { FixedFeatureOverview } from '../../../../components';
 
-<FixedFeatureOverview />
+<div className='light-mode'>
+  <FixedFeatureOverview />
+</div>
 
 ## 安装
 

+ 3 - 1
apps/docs/src/zh/examples/fixed-layout/fixed-layout-simple.mdx

@@ -7,7 +7,9 @@ outline: false
 
 import { FixedLayoutSimplePreview } from '../../../../components';
 
-<FixedLayoutSimplePreview />
+<div className='light-mode'>
+  <FixedLayoutSimplePreview />
+</div>
 
 ## 安装
 

+ 3 - 1
apps/docs/src/zh/examples/free-layout/free-feature-overview.mdx

@@ -7,7 +7,9 @@ outline: false
 
 import { FreeFeatureOverview } from '../../../../components';
 
-<FreeFeatureOverview />
+<div className='light-mode'>
+  <FreeFeatureOverview />
+</div>
 
 ## 安装
 

+ 3 - 1
apps/docs/src/zh/examples/free-layout/free-layout-simple.mdx

@@ -7,7 +7,9 @@ outline: false
 
 import { FreeLayoutSimplePreview } from '../../../../components';
 
-<FreeLayoutSimplePreview />
+<div className='light-mode'>
+  <FreeLayoutSimplePreview />
+</div>
 
 ## 安装