emotion#keyframes TypeScript Examples

The following examples show how to use emotion#keyframes. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: stylesheets.tsx    From animation-editor with MIT License 6 votes vote down vote up
compileStylesheetLabelled = <T extends StylesheetFn, K = keyof ReturnType<T>>(
	stylesheet: T,
) => {
	const obj = stylesheet({ css: (...args: any[]) => args as any, keyframes });
	const newObj = Object.keys(obj).reduce<any>((newObj, key) => {
		newObj[key] = `${key} ${css(...obj[key])}`;
		return newObj;
	}, {});
	return createGetterFn<K>(newObj);
}
Example #2
Source File: stylesheets.tsx    From animation-editor with MIT License 5 votes vote down vote up
compileStylesheet = <T extends StylesheetFn, K = keyof ReturnType<T>>(
	stylesheet: T,
) => {
	return createGetterFn<K>(stylesheet({ css, keyframes }));
}