Skip to content

Commit c4c2f7b

Browse files
authored
fix: align WebView background color with app's ItemBackground in dark mode (#25)
- Updated WebView background from #111214 to #1C1C1E to match ItemBackground.colorset - Updated CSS dark mode backgrounds to use consistent colors - Changed subtle/blockquote backgrounds to #141416 for better contrast hierarchy - Ensures WebView content blends seamlessly with the app's UI in dark mode
1 parent c7f7e4c commit c4c2f7b

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

V2er/View/FeedDetail/HtmlView.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ fileprivate struct Webview: UIViewRepresentable, WebViewHandlerDelegate {
7070
// Set WebView background based on current UI mode to prevent white flash
7171
let isDark = determineIsDarkMode()
7272
webView.isOpaque = false
73-
webView.backgroundColor = isDark ? UIColor(red: 0.067, green: 0.071, blue: 0.078, alpha: 1.0) : UIColor.white
74-
webView.scrollView.backgroundColor = isDark ? UIColor(red: 0.067, green: 0.071, blue: 0.078, alpha: 1.0) : UIColor.white
73+
webView.backgroundColor = isDark ? UIColor(red: 0x1C/255.0, green: 0x1C/255.0, blue: 0x1E/255.0, alpha: 1.0) : UIColor.white
74+
webView.scrollView.backgroundColor = isDark ? UIColor(red: 0x1C/255.0, green: 0x1C/255.0, blue: 0x1E/255.0, alpha: 1.0) : UIColor.white
7575

7676
return webView
7777
}
@@ -85,8 +85,8 @@ fileprivate struct Webview: UIViewRepresentable, WebViewHandlerDelegate {
8585

8686
// Update WebView background color to match current UI mode
8787
webView.isOpaque = false
88-
webView.backgroundColor = isDark ? UIColor(red: 0.067, green: 0.071, blue: 0.078, alpha: 1.0) : UIColor.white
89-
webView.scrollView.backgroundColor = isDark ? UIColor(red: 0.067, green: 0.071, blue: 0.078, alpha: 1.0) : UIColor.white
88+
webView.backgroundColor = isDark ? UIColor(red: 0x1C/255.0, green: 0x1C/255.0, blue: 0x1E/255.0, alpha: 1.0) : UIColor.white
89+
webView.scrollView.backgroundColor = isDark ? UIColor(red: 0x1C/255.0, green: 0x1C/255.0, blue: 0x1E/255.0, alpha: 1.0) : UIColor.white
9090

9191
let fontSize = 16
9292
let params = "\(isDark), \(fontSize)"

V2er/www/v2er.css

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ img {
2929
}
3030

3131
.dark .topic_content{
32-
background:#111214;
32+
background:#1C1C1E;
3333
color:#7F8082;
3434
}
3535

@@ -43,7 +43,7 @@ div.subtle {
4343
}
4444

4545
.dark div.subtle {
46-
background:#08090b;
46+
background:#141416;
4747
}
4848

4949
blockquote {
@@ -56,7 +56,7 @@ blockquote {
5656
}
5757

5858
.dark blockquote {
59-
background:#08090b;
59+
background:#141416;
6060
color:#7F8082;
6161
}
6262

@@ -66,11 +66,11 @@ div.subtle blockquote {
6666
}
6767

6868
.dark div.subtle blockquote {
69-
background:#08090b;
69+
background:#141416;
7070
}
7171

7272
.dark div.subtle .topic_content {
73-
background:#08090b;
73+
background:#141416;
7474
}
7575

7676
div.subtle span.fade {

0 commit comments

Comments
 (0)