styled.rs

 1use crate::{Hoverable, Refineable, RefinementCascade};
 2
 3pub trait Styled {
 4    type Style: Refineable + Default;
 5
 6    fn style_cascade(&mut self) -> &mut RefinementCascade<Self::Style>;
 7    fn declared_style(&mut self) -> &mut <Self::Style as Refineable>::Refinement;
 8
 9    fn computed_style(&mut self) -> Self::Style {
10        Self::Style::from_refinement(&self.style_cascade().merged())
11    }
12
13    fn hover(self) -> Hoverable<Self>
14    where
15        Self: Sized,
16    {
17        Hoverable::new(self)
18    }
19
20    // fn active(self) -> Pressable<Self>
21    // where
22    //     Self: Sized,
23    // {
24    //     pressable(self)
25    // }
26}