Gate Optional Effect At The Shared Primitive

Put a user's on/off setting for an optional decorative surface treatment inside the one shared primitive that draws it — published from the theme as a CompositionLocal defaulting to on — instead of asking every call site to check the flag. Covers why the off path must keep the shape and the hit target and change only the paint, why the default is true rather than false, and the difference between a call site that picks a material and one that picks a different composable. Use when a settings toggle reaches only some of the surfaces it names, when a gated component renders as a bare box in previews, or when turning an effect off also moves the layout.

maxrave-dev 7688b34 8.9 KB Updated

File contents

maxrave-dev/kotlin-footguns/tree/main/skills/gate-optional-effect-at-the-shared-primitive commit 7688b34537

Frequently asked questions

npx skillmds@latest add maxrave-dev/gate-optional-effect-at-the-shared-primitive