UNPKG

@compiled/react

Version:

A familiar and performant compile time CSS-in-JS library for React.

52 lines 1.06 kB
import { createSetupError } from '../utils/error'; /** * ## Styled component * * Create a component that styles a JSX element which comes with built-in behavior such as `ref` and `as` prop support. * For further details [read the documentation](https://compiledcssinjs.com/docs/api-styled). * * ### Style with objects * * @example * ``` * styled.div({ * fontSize: 12, * }); * ``` * * ### Style with template literals * * @example * ``` * styled.div` * font-size: 12px * `; * ``` * * ### Compose styles with arrays * * @example * ``` * import { css } from '@compiled/react'; * * styled.div([ * { fontSize: 12 }, * css`font-size: 12px;` * ]); * * styled.div( * { fontSize: 12 }, * css`font-size: 12px` * ); * ``` */ export const styled = new Proxy({}, { get() { return () => { // Blow up if the transformer isn't turned on. // This code won't ever be executed when setup correctly. throw createSetupError(); }; }, }); //# sourceMappingURL=index.js.map