/
index.ts
46 lines (42 loc) · 1.02 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/* eslint-disable import/export */
import type { CSSProps, CssObject, CssFunction } from '../types';
import { createSetupError } from '../utils/error';
/**
* ## CSS
*
* Define styles that are statically typed and useable with other Compiled APIs.
* For further details [read the documentation](https://compiledcssinjs.com/docs/api-css).
*
* ### Style with objects
*
* @example
* ```
* const redText = css({
* color: 'red',
* });
*
* <div css={redText} />
* ```
*
* ### Style with template literals
*
* @example
* ```
* const redText = css`
* color: red;
* `;
*
* <div css={redText} />
* ```
*/
export default function css<TProps = void>(
styles: TemplateStringsArray,
...interpolations: CssFunction<TProps>[]
): CSSProps<TProps>;
export default function css<T = void>(styles: CssObject<T> | CssObject<T>[]): CSSProps<T>;
export default function css<T = void>(
_styles: TemplateStringsArray | CssObject<T> | CssObject<T>[],
..._interpolations: CssFunction[]
): CSSProps<T> {
throw createSetupError();
}