mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 04:48:53 +00:00
18 lines
473 B
TypeScript
18 lines
473 B
TypeScript
import { getEnvironment } from '@affine/env';
|
|
import createCache from '@emotion/cache';
|
|
|
|
const isBrowser = getEnvironment().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 });
|
|
}
|