Update examples, add css
This commit is contained in:
57 files changed
+964
-595
No files matched your search
+4
-10
@@ -1,28 +1,22 @@
|
||||
//! This example shows how to use a custom index.html and custom <HEAD> extensions
|
||||
//! to add things like stylesheets, scripts, and third-party JS libraries.
|
||||
|
||||
use dioxus::desktop::Config;
|
||||
use dioxus::prelude::*;
|
||||
|
||||
fn main() {
|
||||
LaunchBuilder::desktop()
|
||||
.with_cfg(
|
||||
Config::new().with_custom_head("<style>body { background-color: red; }</style>".into()),
|
||||
)
|
||||
.launch(app);
|
||||
|
||||
LaunchBuilder::desktop()
|
||||
.with_cfg(
|
||||
Config::new().with_custom_index(
|
||||
dioxus::desktop::Config::new().with_custom_index(
|
||||
r#"
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Dioxus app</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<style>body { background-color: blue; }</style>
|
||||
<style>body { background-color: olive; }</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>External HTML</h1>
|
||||
<div id="main"></div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -35,6 +29,6 @@ fn main() {
|
||||
|
||||
fn app() -> Element {
|
||||
rsx! {
|
||||
div { h1 { "hello world!" } }
|
||||
h1 { "Custom HTML!" }
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user