Skip to content

fix: migrate floem to git, expand Tailwind utilities, and fix compatibility#1

Open
elcoosp wants to merge 23 commits into
lapce:mainfrom
elcoosp:main
Open

fix: migrate floem to git, expand Tailwind utilities, and fix compatibility#1
elcoosp wants to merge 23 commits into
lapce:mainfrom
elcoosp:main

Conversation

@elcoosp
Copy link
Copy Markdown

@elcoosp elcoosp commented Apr 25, 2026

Summary

This PR transitions the floem-tailwind dependency from a local path to the upstream floem Git repository, adapts the codebase to the latest Floem API changes, and massively expands the set of available Tailwind‑style utility methods.

Dependency Change

  • From: floem = { path = "../floem" }
  • To: floem = { git = "https://github.com/lapce/floem" }

This removes the local path dependency and pins to the latest Floem HEAD.

Adaptations for Upstream Floem Changes

  • Replaced peniko direct dependency with floem::peniko re‑exports.
  • Updated imports: PxPctAutoLengthAuto, WeightFontWeight, SEMIBOLDSEMI_BOLD.
  • Fixed method signatures to match current Floem API:
    • justify_content / align_items / align_self no longer take Option<…>.
    • self_auto no longer passes None to align_self, just returns self.
    • m_auto, mx_auto, … now use LengthAuto::Auto.
  • Updated demo example to use the new Floem widget constructors (Stack::vertical, Label::derived, Button::new, Empty::new, etc.).

New Tailwind Utility Modules

Added traits and their scope

Module / Trait Covers
flexbox (TailwindFlexboxExt) Direction, wrap, grow/shrink, full basis scale (0‑96), justify/align/align‑self/align‑content
layout (TailwindLayoutExt) Display, position, z‑index, inset‑x/y‑0, text‑overflow
interactivity (TailwindInteractivityExt) Cursor styles, user‑select, pointer‑events
gap (TailwindGapExt) Column‑gap and row‑gap for the full spacing scale
border_side (TailwindBorderSideExt) Per‑side border widths (t/r/b/l, x, y)
opacity (TailwindOpacityExt) Opacity values 5‑100 (in 5% steps)
special_colors (TailwindSpecialColorExt) White, black, transparent (bg/text/border)
colors_ext (TailwindColorExt) Additional 16 colour families (all shades), bringing the total to all 22 Tailwind families
leading (TailwindLeadingExt) Line‑height utilities (numeric 3‑10, and named none‑loose)
inset (TailwindInsetExt) Top/right/bottom/left/inset/inset‑x/inset‑y for the full 0‑96 scale
min_max_height (TailwindMinMaxHeightExt) Min‑height and max‑height for the full 0‑96 scale
number_font_size (TailwindNumberFontSizeExt) Numeric font‑size utilities (text_12text_96)

All new traits are publicly exported from lib.rs.

Colour families covered

The combination of the original TailwindExt, TailwindSpecialColorExt, and TailwindColorExt now includes:

Backgrounds, text colours, and border colours for every Tailwind family (22 families, shades 50950):
slate, gray, zinc, neutral, stone, red, orange, amber, yellow, lime, green, emerald, teal, cyan, sky, blue, indigo, violet, purple, fuchsia, pink, rose

Plus white, black, transparent via the special‑colours trait.

Code Quality & Testing

  • Removed broken font_weight reference from old code.
  • Cleaned up unnecessary mut self in new modules.
  • Corrected gap utilities to use col_gap/row_gap instead of generic gap.
  • Fixed and finalised inset module and integration tests.
  • Added macro‑driven integration tests (tests/utilities.rs) covering every method of every new trait.
  • All new code compiles and passes tests.

Documentation

  • Added a comprehensive README.md for the floem-tailwind crate.
  • Included a justfile with test and wr (watch) recipes.

Checklist

  • Migrate floem to public Git repository
  • Adapt to latest Floem API (no more Option<…>, changed types)
  • Add 12 new utility traits covering the full Tailwind CSS utility set
  • Extend colour palette to all 22 families
  • Add integration tests for every new method
  • Update demo and documentation
  • Ensure all tests pass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant