Utility functions for parsing and transforming CSS style strings, color values, and transforms, originally companion to animation libraries tween-one, queue-anim, and scroll-anim (v0.3.8). Provides color parsing (hex, rgb, hsl, modern CSS), shadow parsing, transform decomposition, camelCase/snake_case conversions, vendor prefix normalization, and style merging. Lightweight, no dependencies, supports modern color syntax. Last release 2021; used primarily in older animation libraries.
npm install style-utilsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows parsing a color to RGBA array, decomposing a CSS transform string, and checking vendor prefix for a CSS property.
Use hex, rgb, rgba, hsl, hsla string format only.
Access properties using lowercase: transform.translatex instead of transform.translateX.
Use checkStyleName to get the correct property name for the current browser.
Use import { parseColor } from 'style-utils'Run npm install style-utils
Pass a valid hex, rgb/a, hsl/a color string. See parseColor docs.
No dependency data recorded yet.