use bevy::{
prelude::*,
ui::FocusPolicy,
};
use tomt_bevycss::prelude::*;
#[derive(Debug, Default)]
#[derive(Component, Reflect)]
#[reflect(Component)]
struct Title;
fn main(
// no args
) {
App::new()
.add_plugins(DefaultPlugins)
// Whenever an StyleSheet is loaded, it'll be applied automatically
.add_plugins(BevyCssPlugin::with_hot_reload())
.add_systems(Startup, setup)
.add_systems(Update, change_theme)
.register_component_selector::
("title")
.run();
}
#[derive(Resource)]
struct Themes
{
pub root: Entity,
pub dark: Handle,
pub light: Handle,
}
fn change_theme(
themes: Res,
mut styles_query: Query<&mut StyleSheet>,
interaction_query: Query<&Interaction, (Changed, With