I wanted my app to stop looking like every other Material 3 app, so I removed material3 entirely. The app depends only on runtime, ui, foundation and animation. The whole theme is about 420 lines of Kotlin. Here's how it fits together.
1. Tokens are plain u/Immutable data classes
The tokens are named by role rather than by Material slots like primary and surface:
data class SignalColors(
val isDark: Boolean,
val paper: Color, // background
val ink: Color, // primary text
val download: Color,
val upload: Color,
val warning: Color, // only used for an over-budget forecast
// âŠ
)
The same pattern covers type, spacing, shapes and motion. Light and dark themes are just two instances.
2. One static CompositionLocal per token group
val LocalSignalColors = staticCompositionLocalOf { LightSignalColors }
object Signal {
val colors: SignalColors
u/ReadOnlyComposable get() = LocalSignalColors.current
}
Call sites read Signal.colors.ink or Signal.type.body, which looks like MaterialTheme with none of its baggage. I used staticCompositionLocalOf because these values almost never change, so a change recomposing the whole tree is acceptable.
3. A replacement for the ripple
Removing Material also removes the ripple, so I wrote an IndicationNodeFactory that draws a 10% ink wash over the pressed element. It's a Modifier.Node that collects PressInteractions and animates its alpha. It's provided once as LocalIndication, so every clickable uses it automatically.
4. One variable font, roles fixed in code
Mona Sans is a single variable font. FontFamily only resolves fonts by weight, so each type role is built as its own family, with width and optical size set in that family's FontVariation.Settings. Numbers use the wide width, body text the normal width, and the status-bar icon the condensed width.
5. Motion that follows accessibility settings
Motion tokens are tween specs. Compose already scales animation durations by the system animator scale. For animation it can't scale (a chart that scrolls continuously), a ContentObserver watches ANIMATOR_DURATION_SCALE and sets a reduced flag.
6. Plain JVM tests for the palette
A tiny WCAG contrast helper runs in ordinary JUnit tests, so a colour change that fails contrast also fails the build. No emulator is needed.