Skip to content

Commit

Permalink
Update docs site to use prefix plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
cee-chen committed Oct 9, 2023
1 parent cfe58f6 commit 6df89a1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src-docs/src/components/codesandbox/link.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,13 @@ import '@elastic/charts/dist/theme_only_${colorMode}.css';`
import React from 'react';
import { createRoot } from 'react-dom/client';
import createCache from '@emotion/cache';
import { EuiProvider } from '@elastic/eui';
import { EuiProvider, euiStylisPrefixer } from '@elastic/eui';
import { Demo } from './demo';
const cache = createCache({
key: 'codesandbox',
stylisPlugins: [euiStylisPrefixer],
container: document.querySelector('meta[name="emotion-styles"]'),
});
cache.compat = true;
Expand Down
3 changes: 3 additions & 0 deletions src-docs/src/views/app_context.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { translateUsingPseudoLocale } from '../services';
import { getLocale } from '../store';

import { EuiContext, EuiProvider } from '../../../src/components';
import { euiStylisPrefixer } from '../../../src/services';
import { EUI_THEMES } from '../../../src/themes';

import favicon16Prod from '../images/favicon/prod/favicon-16x16.png';
Expand All @@ -19,11 +20,13 @@ import favicon96Dev from '../images/favicon/dev/favicon-96x96.png';

const generalEmotionCache = createCache({
key: 'css',
stylisPlugins: [euiStylisPrefixer],
container: document.querySelector('meta[name="emotion-styles"]'),
});
generalEmotionCache.compat = true;
const utilityCache = createCache({
key: 'util',
stylisPlugins: [euiStylisPrefixer],
container: document.querySelector('meta[name="emotion-styles-utility"]'),
});

Expand Down
5 changes: 3 additions & 2 deletions src-docs/src/views/provider/provider_styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@ export default () => {

<EuiCodeBlock language="jsx" fontSize="m" isCopyable>
{`// App.js
import { EuiProvider } from '@elastic/eui'
import { EuiProvider, euiStylisPrefixer } from '@elastic/eui'
import createCache from '@emotion/cache';
const euiCache = createCache({
key: 'eui',
stylisPlugins: [euiStylisPrefixer],
container: document.querySelector('meta[name="eui-style-insert"]'),
});
cache.compat = true;
euiCache.compat = true;
<EuiProvider${colorMode === 'DARK' ? ' colorMode="dark"' : ''} cache={euiCache}>
{/* Content */}
Expand Down
1 change: 1 addition & 0 deletions src/services/emotion/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
*/

export * from './clone_element';
export * from './prefixer';

0 comments on commit 6df89a1

Please sign in to comment.