use crate::node::{Node, View};
#[derive(Debug, PartialEq, Eq)]
pub struct Stylesheet {
pub id: &'static str,
pub css: &'static str,
}
impl View for &'static Stylesheet {
fn into_node(self) -> Node {
Node::Style(self)
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct CssClass {
pub name: &'static str,
pub sheet: &'static Stylesheet,
}
impl CssClass {
pub const fn new(name: &'static str, sheet: &'static Stylesheet) -> Self {
Self { name, sheet }
}
}
impl std::fmt::Display for CssClass {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(self.name)
}
}