Radium is a CSS-in-JS styling library that transforms static inline styles into dynamic, responsive, and animated CSS for React components. It functions as a component style toolchain and React inline style enhancer, allowing developers to define styles using plain JavaScript objects while gaining capabilities like browser state handling, vendor prefixing, and style composition.
The library extends React's inline style system by automatically resolving browser state styles for hover, focus, and active interactions without manual event handlers. It supports inline media queries that evaluate at runtime based on viewport dimensions, and provides a keyframe animation helper that generates unique animation names and injects CSS animations using JavaScript. Radium also handles cross-browser compatibility through automatic vendor prefix auto-prefixing of CSS property names and values.
For style composition, Radium merges multiple style objects in order to dynamically build styles from component props or state. The library processes styles through a plugin-based pipeline that handles prefixing, media queries, and keyframe generation in sequence, with runtime CSS keyframe injection into the document.