-
Notifications
You must be signed in to change notification settings - Fork 7
/
main.ts
26 lines (20 loc) · 920 Bytes
/
main.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
import {IOptions, IInjectedData, IStyles} from './types';
import {getProcessedCssWithConfig, getStaticCssWithConfig} from './standalone';
export type IGetProcessedCssFn = typeof getProcessedCss;
export type IGetStaticCssFn = typeof getStaticCss;
export function getProcessedCss(styles: IStyles, options?: Partial<IOptions>): string {
const injectedData = '__COMPILATION_HASH__INJECTED_DATA_PLACEHOLDER' as any;
const processedCssConfig = {
...injectedData,
compilationHash: '__COMPILATION_HASH__',
};
return getProcessedCssWithConfig(processedCssConfig, styles, options);
}
export function getStaticCss(options?: Pick<IOptions, 'prefixSelector'>) {
const injectedData: IInjectedData = '__COMPILATION_HASH__INJECTED_STATIC_DATA_PLACEHOLDER' as any;
const cssConfig = {
...injectedData,
compilationHash: '__COMPILATION_HASH__',
};
return getStaticCssWithConfig(cssConfig, options);
}