UNPKG

2.12 kBTypeScriptView Raw
1import { MaybeThunk, MaybeArray, Falsy, Directive, CSSRules, CSSAtKeyframes, CSSProperties, Context } from 'twind';
2export * from 'twind';
3
4/**
5 * [[include:src/css/README.md]]
6 *
7 * @packageDocumentation
8 * @module twind/css
9 */
10
11interface CSSFactory<T, I, R> {
12 (strings: TemplateStringsArray, ...interpolations: readonly MaybeThunk<MaybeArray<I | string | number | Falsy>>[]): Directive<R>;
13 (tokens: MaybeThunk<MaybeArray<T | Falsy>>): Directive<R>;
14 (...tokens: readonly MaybeThunk<T | Falsy>[]): Directive<R>;
15}
16declare const css: CSSFactory<CSSRules, CSSRules, CSSRules>;
17/**
18 *
19 * ```js
20 * const bounce = keyframes({
21 * 'from, 20%, 53%, 80%, to': {
22 * transform: 'translate3d(0,0,0)',
23 * },
24 * '40%, 43%': {
25 * transform: 'translate3d(0, -30px, 0)',
26 * },
27 * '70%': {
28 * transform: 'translate3d(0, -15px, 0)',
29 * },
30 * '90%': {
31 * transform: 'translate3d(0, -4px, 0)',
32 * }
33 * })
34 *
35 * css({
36 * animation: `${bounce} 1s ease infinite`,
37 * })
38 * ```
39 * @param waypoints
40 */
41declare const keyframes: CSSFactory<CSSAtKeyframes, CSSAtKeyframes | CSSProperties, string>;
42/**
43 *
44 * ```js
45 * const bounce = animation('1s ease infinite', {
46 * 'from, 20%, 53%, 80%, to': {
47 * transform: 'translate3d(0,0,0)',
48 * },
49 * '40%, 43%': {
50 * transform: 'translate3d(0, -30px, 0)',
51 * },
52 * '70%': {
53 * transform: 'translate3d(0, -15px, 0)',
54 * },
55 * '90%': {
56 * transform: 'translate3d(0, -4px, 0)',
57 * }
58 * })
59 * ```
60 */
61interface Animation {
62 (value: string | CSSRules | ((context: Context) => string)): CSSFactory<CSSAtKeyframes, CSSAtKeyframes | CSSProperties, CSSRules>;
63 (value: string | CSSRules | ((context: Context) => string), waypoints: CSSAtKeyframes | Directive<string>): Directive<CSSRules>;
64}
65declare const animation: Animation;
66interface Screen {
67 (size: string): Directive<string>;
68 (size: string, css: Directive<CSSRules> | MaybeArray<CSSRules | Falsy>): Directive<CSSRules>;
69}
70declare const screen: Screen;
71
72export { Animation, CSSFactory, Screen, animation, css, keyframes, screen };
73//# sourceMappingURL=css.d.ts.map
74
\No newline at end of file