Feature implementation status and future plans for EmergeSkia.

Elm-UI Feature Implementation

Goal: Implement elm-ui API one feature at a time until layout + rendering coverage is complete.

Feature Status

Core Elements

FeatureElixir APILayoutRenderNotes
text
el
row
column
wrappedRow
none
paragraphInline text flow
textColumnMulti-paragraph with float flow around alignLeft/alignRight
imageAsync Rust-loaded image element

Sizing

FeatureElixir APILayoutRenderNotes
pxN/A
fillN/A
fillPortionN/A
shrink/contentN/A
minimumN/A
maximumN/A

Spacing & Padding

FeatureElixir APILayoutRenderNotes
padding (uniform)N/A
paddingXYN/A
paddingEachN/A
spacingN/A
spacingXYN/ADifferent H/V spacing
spaceEvenlyN/ASpace-between gaps

Alignment

FeatureElixir APILayoutRenderNotes
centerXN/A
centerYN/A
alignLeftN/A
alignRightN/A
alignTopN/A
alignBottomN/A

Nearby Positioning

FeatureElixir APILayoutRenderNotes
aboveLeft-start above host; width fill uses host width
belowLeft-start below host; width fill uses host width
onLeftTop-start left of host; height fill uses host height
onRightTop-start right of host; height fill uses host height
inFrontBorder-box slot; fill uses both axes; explicit size may overflow
behindContentBorder-box slot between background and content

Background

FeatureElixir APILayoutRenderNotes
colorN/A
gradientN/ALinear only
imageN/ADefault :cover; supports contain/cover/repeat modes
uncroppedN/A:contain background helper
tiledN/ARepeat on both axes
tiledXN/ARepeat on X axis only
tiledYN/ARepeat on Y axis only

Border

FeatureElixir APILayoutRenderNotes
widthN/AInteraction-style compatible
colorN/AInteraction-style compatible
rounded (uniform)N/AInteraction-style compatible
roundEachN/APer-corner rendering + interaction-style compatible
widthEachN/APer-edge width with clip-based rendering + interaction-style compatible
dashed/dottedN/ADashPathEffect-based rendering + interaction-style compatible
shadowN/AMaskFilter blur, supports inset; interaction-style compatible
glowN/ASugar over shadow with zero offset; interaction-style compatible

Typography

FeatureElixir APILayoutRenderNotes
Font.sizeInherited + interaction-style compatible
Font.colorN/AInherited + interaction-style compatible
Font.familyFamily inheritance + fallback; interaction-style compatible
Font.boldWeight mapping with synthetic fallback; interaction-style compatible
Font.italicItalic mapping with synthetic fallback; interaction-style compatible
Font.strikeInherited + interaction-style compatible
Font.underlineInherited + interaction-style compatible
Font.letterSpacingInherited + interaction-style compatible
Font.wordSpacingInherited + interaction-style compatible
Font.alignLeft/Right/CenterText alignment + interaction-style compatible

Transforms

FeatureElixir APILayoutRenderNotes
move_x / move_yEquivalent to elm-ui move helpers
rotate
scale

Effects

FeatureElixir APILayoutRenderNotes
alpha/opacityN/A

Clipping & Scrolling

FeatureElixir APILayoutRenderNotes
clipXN/A
clipYN/A
scrollbarYClips to padded content; updates scroll max
scrollbarXClips to padded content; updates scroll max

Input Elements

FeatureStatusNotes
Input.button
Input.checkbox
Input.textSingle-line controlled text input
Input.multilineWrapped multiline input with auto-grow and multiline editing
Input.slider
Input.radio

Possible Layout Engine Improvements

Based on analysis of taffy layout engine. Focus is on elm-ui semantics, not CSS compatibility.

Layout Caching

Taffy uses a 9-slot cache per node to avoid redundant calculations. Our implementation recalculates everything on every layout pass.

pub struct LayoutCache {
    cached_size: Option<(Option<f32>, Option<f32>, IntrinsicSize)>,
    generation: u32,  // Invalidation counter
}

Benefit: Significant performance improvement for incremental updates.

Pixel Rounding Pass

Taffy rounds based on cumulative coordinates to prevent pixel gaps:

fn round_layout(tree: &mut ElementTree) {
    for element in tree.nodes.values_mut() {
        if let Some(frame) = &mut element.frame {
            // Round edges, not dimensions (prevents gaps)
            let left = frame.x.round();
            let top = frame.y.round();
            let right = (frame.x + frame.width).round();
            let bottom = (frame.y + frame.height).round();
            frame.x = left;
            frame.y = top;
            frame.width = right - left;
            frame.height = bottom - top;
        }
    }
}

Benefit: Crisp pixel-perfect rendering, eliminates hairline gaps.

Separate Size Computation Mode

Taffy has RunMode::ComputeSize for measuring without full layout:

pub enum LayoutMode {
    FullLayout,      // Compute frames
    MeasureOnly,     // Just compute sizes (faster)
}

Benefit: Faster intrinsic size queries without side effects.

These CSS features from taffy should not be added:

  • CSS Grid (elm-ui uses row/column composition)
  • Absolute/relative positioning (elm-ui uses above/below/inFront/behind)
  • Margin collapse (elm-ui uses spacing)
  • Flexbox shrink factors (elm-ui uses simpler model)
  • Complex percentage resolution (elm-ui percentages are rare)
  • Aspect ratio constraints (not in elm-ui)

Upcoming Features

  • Input primitives (button, checkbox, text, slider, etc.)