use crate::prelude::*;
use beet_core::prelude::*;
use std::hash::Hash;
#[derive(
Debug, Default, Clone, Copy, PartialEq, Eq, Hash, Component, Reflect,
)]
#[reflect(Component)]
#[component(immutable)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "tokens", derive(ToTokens))]
pub struct StyleCascade;
impl TemplateDirective for StyleCascade {
fn try_from_attribute(key: &str, value: Option<&TextNode>) -> Option<Self> {
match (key, value) {
("style:cascade", _) => Some(Self),
_ => None,
}
}
}
#[derive(
Debug, Default, Clone, Copy, PartialEq, Eq, Hash, Component, Reflect,
)]
#[reflect(Component)]
#[component(immutable)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "tokens", derive(ToTokens))]
pub enum StyleScope {
#[default]
Local,
Global,
}
impl TemplateDirective for StyleScope {
fn try_from_attribute(key: &str, value: Option<&TextNode>) -> Option<Self> {
match (key, value) {
("scope:local", _) => Some(Self::Local),
("scope:global", _) => Some(Self::Global),
_ => None,
}
}
}