-
Notifications
You must be signed in to change notification settings - Fork 32
/
primary-secondary.rs
53 lines (51 loc) · 1.5 KB
/
primary-secondary.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
use belly::prelude::*;
use bevy::prelude::*;
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugins(BellyPlugin)
.add_systems(Startup, setup)
.run();
}
fn setup(mut commands: Commands) {
commands.spawn(Camera2dBundle::default());
commands.add(StyleSheet::parse(
r#"
div {
width: 100%;
padding: 10px;
flex-direction: column;
}
.primary {
background-color: white;
color: black;
}
.primary * {
color: black;
}
.secondary {
background-color: black;
color: white;
}
.secondary * {
color: white;
}
"#,
));
commands.add(eml! {
<body>
<div c:primary>"bevy primary 1"<div>"bevy primary 1 inner"</div>
<div c:secondary>"bevy secondary 1"<div>"bevy secondary 1 inner"</div>
<div c:primary>"bevy primary 2"<div>"bevy primary 2 inner"</div>
<div c:secondary>"bevy secondary 2"<div>"beby secondary 2 inner"</div>
<div c:primary>"bevy primary 3"<div>"bevy primary 3 inner"</div>
<div c:secondary>"bevy secondary 3"<div>"bevy secondary 3 inner"</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
});
}