Skip to content

Text styling modifiers - #26

Merged
colemancda merged 5 commits into
masterfrom
feature/text-styling
Jul 23, 2026
Merged

Text styling modifiers#26
colemancda merged 5 commits into
masterfrom
feature/text-styling

Conversation

@colemancda

Copy link
Copy Markdown
Member

First parity tier: text styling. Adds the text-attribute modifiers and applies them as parameters of the Compose Text composable (they describe the text, not the layout Modifier chain, so they are read off a Text node's modifier list rather than folded).

New modifiers

  • .font(_:) — named styles (.largeTitle.caption2, resolved to point sizes by the interpreter) and .system(size:weight:)
  • .foregroundColor(_:) / .foregroundStyle(_:)
  • .bold() / .fontWeight(_:)
  • .italic()
  • .lineLimit(_:)
  • .multilineTextAlignment(_:)

Multiple text modifiers compose on one Text; later (innermost) entries win for scalar attributes, and layout modifiers in the same chain still apply normally.

Verification

  • swift test — 6 new emission tests, 35 total passing
  • Emulator: Text playground shows font sizes (largeTitle→caption, headline correctly semibold), weight/italic/heavy, colors, composed title + bold + green, and lineLimit(2) truncation vs. full multiline

Deferred

Container-level font/color environment propagation (styling only applies when set directly on a Text). Tracked for a later tier.

@colemancda
colemancda merged commit f63a2d5 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