@@ -8,6 +8,7 @@ use std::{fmt::Debug, ops::Range};
use taffy::{
TaffyTree, TraversePartialTree as _,
geometry::{Point as TaffyPoint, Rect as TaffyRect, Size as TaffySize},
+ prelude::min_content,
style::AvailableSpace as TaffyAvailableSpace,
tree::NodeId,
};
@@ -295,7 +296,7 @@ trait ToTaffy<Output> {
impl ToTaffy<taffy::style::Style> for Style {
fn to_taffy(&self, rem_size: Pixels, scale_factor: f32) -> taffy::style::Style {
- use taffy::style_helpers::{fr, length, minmax, repeat};
+ use taffy::style_helpers::{length, minmax, repeat};
fn to_grid_line(
placement: &Range<crate::GridPlacement>,
@@ -309,8 +310,8 @@ impl ToTaffy<taffy::style::Style> for Style {
fn to_grid_repeat<T: taffy::style::CheapCloneStr>(
unit: &Option<u16>,
) -> Vec<taffy::GridTemplateComponent<T>> {
- // grid-template-columns: repeat(<number>, minmax(0, 1fr));
- unit.map(|count| vec![repeat(count, vec![minmax(length(0.0), fr(1.0))])])
+ // grid-template-columns: repeat(<number>, minmax(0, min-content));
+ unit.map(|count| vec![repeat(count, vec![minmax(length(0.0), min_content())])])
.unwrap_or_default()
}
@@ -520,7 +520,6 @@ fn render_markdown_table(parsed: &ParsedMarkdownTable, cx: &mut RenderContext) -
.px_2()
.py_1()
.border_1()
- .size_full()
.border_color(cx.border_color)
.when(cell.is_header, |this| {
this.bg(cx.title_bar_background_color)
@@ -551,7 +550,6 @@ fn render_markdown_table(parsed: &ParsedMarkdownTable, cx: &mut RenderContext) -
let empty_cell = div()
.border_1()
- .size_full()
.border_color(cx.border_color)
.when(row_idx % 2 == 1, |this| this.bg(cx.panel_background_color));
@@ -560,7 +558,7 @@ fn render_markdown_table(parsed: &ParsedMarkdownTable, cx: &mut RenderContext) -
}
}
- cx.with_common_p(div())
+ cx.with_common_p(v_flex().items_start())
.when_some(parsed.caption.as_ref(), |this, caption| {
this.children(render_markdown_text(caption, cx))
})