mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-11 15:16:28 +08:00
18 lines
449 B
TypeScript
18 lines
449 B
TypeScript
import { env } from '@affine/env';
|
|
import createCache from '@emotion/cache';
|
|
|
|
const isBrowser = env.isBrowser;
|
|
|
|
export default function createEmotionCache() {
|
|
let insertionPoint;
|
|
|
|
if (isBrowser) {
|
|
const emotionInsertionPoint = document.querySelector<HTMLMetaElement>(
|
|
'meta[name="emotion-insertion-point"]'
|
|
);
|
|
insertionPoint = emotionInsertionPoint ?? undefined;
|
|
}
|
|
|
|
return createCache({ key: 'affine', insertionPoint });
|
|
}
|