@o2e-brands/pebble-utils
v0.1.0-beta.1
Published
Utility helpers for Pebble UI: cn (clsx + tailwind-merge), string converters, isomorphic layout effect.
Readme
@o2e-brands/pebble-utils
Utility helpers for Pebble UI.
API
import { cn, camelToKebab, kebabToCamel, useIsomorphicLayoutEffect } from "@o2e-brands/pebble-utils"cn(...inputs)
Class name composer using clsx + tailwind-merge. Properly resolves Tailwind class conflicts.
cn("px-4", "px-2") // → "px-2" (last px wins, NOT "px-4 px-2")
cn("bg-primary", isActive && "bg-secondary")
cn(["a", "b"], { c: true })camelToKebab(str), kebabToCamel(str)
String converters used by computeCssVars and similar.
useIsomorphicLayoutEffect
useLayoutEffect on client, useEffect on server. Prevents the SSR warning.
Use whenever you need to mutate the DOM before paint (e.g., injecting CSS variables).
