Checkpoint

This commit is contained in:
Nathan Sobo 2023-08-19 22:33:28 -06:00
parent afff46b335
commit 6663d3f8eb
7 changed files with 350 additions and 367 deletions

View file

@ -78,7 +78,6 @@ pub trait Element<V> {
}
}
use crate as playground; // Macro invocation below references this crate as playground.
pub trait Styleable {
type Style: refineable::Refineable;
@ -89,12 +88,15 @@ pub trait Styleable {
style.refine(self.declared_style());
style
}
}
// Tailwind-style helpers methods that take and return mut self
//
// Example:
// // Sets the padding to 0.5rem, just like class="p-2" in Tailwind.
// fn p_2(mut self) -> Self where Self: Sized;
// Tailwind-style helpers methods that take and return mut self
//
// Example:
// // Sets the padding to 0.5rem, just like class="p-2" in Tailwind.
// fn p_2(mut self) -> Self where Self: Sized;
use crate as playground; // Macro invocation references this crate as playground.
pub trait StyleHelpers: Styleable<Style = Style> {
styleable_helpers!();
}
@ -139,6 +141,8 @@ impl<V: 'static> Element<V> for Div<V> {
Self: Sized,
{
let style = self.style();
style.paint_background::<V, Self>(layout, cx);
}
}