|
1 | | -export const editorStyles = [ |
| 1 | +// Base styles for the content rendered within the BlockCanvas iframe. |
| 2 | +import componentsStyles from '@wordpress/components/build-style/style.css?raw'; |
| 3 | +import componentsStylesRtl from '@wordpress/components/build-style/style-rtl.css?raw'; |
| 4 | +import blockEditorContentStyles from '@wordpress/block-editor/build-style/content.css?raw'; |
| 5 | +import blockEditorContentStylesRtl from '@wordpress/block-editor/build-style/content-rtl.css?raw'; |
| 6 | +import blockLibraryStyles from '@wordpress/block-library/build-style/style.css?raw'; |
| 7 | +import blockLibraryStylesRtl from '@wordpress/block-library/build-style/style-rtl.css?raw'; |
| 8 | +import blockLibraryThemeStyles from '@wordpress/block-library/build-style/theme.css?raw'; |
| 9 | +import blockLibraryThemeStylesRtl from '@wordpress/block-library/build-style/theme-rtl.css?raw'; |
| 10 | +import blockLibraryEditorStyles from '@wordpress/block-library/build-style/editor.css?raw'; |
| 11 | +import blockLibraryEditorStylesRtl from '@wordpress/block-library/build-style/editor-rtl.css?raw'; |
| 12 | + |
| 13 | +const editorStyles = [ |
2 | 14 | { |
3 | 15 | css: ` |
4 | 16 | body { |
@@ -49,3 +61,25 @@ export const editorStyles = [ |
49 | 61 | `, |
50 | 62 | }, |
51 | 63 | ]; |
| 64 | + |
| 65 | +/** |
| 66 | + * Styles to pass to `BlockCanvas`, keyed by the Storybook text direction. |
| 67 | + */ |
| 68 | +export const contentStyles = { |
| 69 | + ltr: [ |
| 70 | + { css: componentsStyles }, |
| 71 | + { css: blockLibraryStyles }, |
| 72 | + { css: blockEditorContentStyles }, |
| 73 | + { css: blockLibraryThemeStyles }, |
| 74 | + { css: blockLibraryEditorStyles }, |
| 75 | + ...editorStyles, |
| 76 | + ], |
| 77 | + rtl: [ |
| 78 | + { css: componentsStylesRtl }, |
| 79 | + { css: blockLibraryStylesRtl }, |
| 80 | + { css: blockEditorContentStylesRtl }, |
| 81 | + { css: blockLibraryThemeStylesRtl }, |
| 82 | + { css: blockLibraryEditorStylesRtl }, |
| 83 | + ...editorStyles, |
| 84 | + ], |
| 85 | +}; |
0 commit comments