Skip to content

Commit a7cfda9

Browse files
committed
feat:Dark mode sample
1 parent 957ac22 commit a7cfda9

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

sample/shared/src/commonMain/kotlin/com/kevinnzou/sample/WebViewApp.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import com.multiplatform.webview.web.rememberWebViewState
1212
@Composable
1313
internal fun WebViewApp() {
1414
// WebViewSample()
15-
BasicWebViewSample()
16-
// BasicWebViewWithHTMLSample()
15+
// BasicWebViewSample()
16+
BasicWebViewWithHTMLSample()
1717
}
1818

1919
@Composable

sample/shared/src/commonMain/kotlin/com/kevinnzou/sample/res/HtmlRes.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ object HtmlRes {
2020
text-align: center;
2121
color: ffffff;
2222
}
23+
@media (prefers-color-scheme: dark) {
24+
body {
25+
background-color: white;
26+
}
27+
h1, h2 {
28+
color: black;
29+
}
30+
}
2331
</style>
2432
</head>
2533
<body>

0 commit comments

Comments
 (0)