🚧 (pagetop): Comparte align entre Flex y Grid
Extrae `Align`/`AlignContent`/`ItemAlign`/`Gap` de Flexbox a un nuevo módulo neutral `html::align` (`Items`/`Content`/`ItemSelf`/`Gap`) para que tambien lo use CSS Grid.
This commit is contained in:
parent
c2ec7568f0
commit
dfff12881f
8 changed files with 291 additions and 73 deletions
|
|
@ -55,7 +55,7 @@ async fn flex_adds_its_styles_to_the_content_area() {
|
|||
async fn flex_gap_adds_a_style_to_the_content_area() {
|
||||
let mut cx = Context::default();
|
||||
let mut navbar = Navbar::simple()
|
||||
.with_flex(Flex::new().with_gap(flex::Gap::Both(UnitValue::RelRem(0.5))))
|
||||
.with_flex(Flex::new().with_gap(align::Gap::Both(UnitValue::RelRem(0.5))))
|
||||
.with_item(navbar::Item::nav(one_link_nav()));
|
||||
let html = navbar.render(&mut cx).await.into_string();
|
||||
let assets = cx.render_assets().into_string();
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ async fn shrink_adds_flex_shrink_style() {
|
|||
async fn align_self_adds_matching_style() {
|
||||
let mut cx = Context::default();
|
||||
let props =
|
||||
Props::default().with_prop(FlexItem::new().with_align_self(flex::ItemAlign::Center));
|
||||
Props::default().with_prop(FlexItem::new().with_align_self(align::ItemSelf::Center));
|
||||
let html = html! { span (props.unpack(&mut cx)) {} }.into_string();
|
||||
let assets = cx.render_assets().into_string();
|
||||
|
||||
|
|
@ -109,7 +109,7 @@ async fn combines_several_facets_in_one_call() {
|
|||
FlexItem::new()
|
||||
.with_grow(flex::ItemGrow::Is1)
|
||||
.with_shrink(flex::ItemShrink::Is0)
|
||||
.with_align_self(flex::ItemAlign::Start)
|
||||
.with_align_self(align::ItemSelf::Start)
|
||||
.with_order(flex::ItemOrder::Is2)
|
||||
.with_size(flex::ItemSize::Custom(UnitValue::Zero))
|
||||
.with_offset(flex::ItemOffset::Percent10),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue