gate-optional-effect-at-the-shared-primitive
Installation
SKILL.md
Gate an optional effect at the shared primitive
An optional decorative surface treatment — a blur, a refraction, a glow, anything the user can switch off — has three parts: a stored preference, a way for the UI to read it, and the draw code. Only the third one is shared. Wire the gate to the third one.
// adapted — one local, published by the app theme, default ON
val LocalDecorEnabled = staticCompositionLocalOf { true }
// inside AppTheme(…, decorEnabled: Boolean = true, …)
CompositionLocalProvider(
LocalDecorEnabled provides decorEnabled,
/* the theme's other locals */
content = content,
)