pub trait StylingElement<S> {
#[must_use]
fn add_to(self, style_set: S) -> S;
}
macro_rules! impl_styling_element_for {
{$type:ty {
args: [$self:ident, $composed_styling:ident];
add_to: $add_to:block
}} => {
impl $crate::StylingElement<$crate::Style> for $type {
fn add_to($self, $composed_styling: $crate::Style) -> $crate::Style {
$add_to
}
}
impl<C: core::fmt::Display> $crate::StylingElement<$crate::Styled<C>> for $type {
fn add_to($self, $composed_styling: $crate::Styled<C>) -> $crate::Styled<C> {
$add_to
}
}
};
}
pub(crate) use impl_styling_element_for;