Skip to content

Appearance: border, shadow, clipShape, and overlay - #32

Merged
colemancda merged 6 commits into
masterfrom
feature/appearance
Jul 23, 2026
Merged

Appearance: border, shadow, clipShape, and overlay#32
colemancda merged 6 commits into
masterfrom
feature/appearance

Conversation

@colemancda

Copy link
Copy Markdown
Member

Sixth tier: appearance modifiers.

What's new

  • .border(_:width:), .shadow(radius:…), .clipShape(_:) — fold into the Compose Modifier chain (border, shadow, clip with the shape mapped from Rectangle/Circle/Capsule/RoundedRectangle).
  • .overlay(alignment:content:) — an Overlay node whose base and overlay stack in a Box, the overlay sized to the base via matchParentSize and positioned by alignment.

Also fixed

Color now fills the width offered it (SwiftUI semantics) — height-only colors previously collapsed to zero width (visible once an overlay's base was a Color.frame(height:)). fillMaxWidth is applied after the modifier chain so an explicit frame width still constrains. Same correction applied to the gradient path.

Verification

  • swift test — 4 new tests (border, clipShape, shadow, overlay base/overlay children + alignment), 52 total passing
  • Emulator (new Appearance screen): bordered text, a shadowed card, circle- and capsule-clipped fills, a badge overlay (bottom-trailing), and a full-width bar with a centered overlay label all render correctly

Deferred

.tint (control theming); custom shadow color/offset (radius → elevation only); stroked shapes.

@colemancda
colemancda merged commit 7e3521a into master Jul 23, 2026
6 checks passed
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