diff --git a/src/components/visual-editor/default-theme-styles.scss b/src/components/visual-editor/default-theme-styles.scss index f4838b358..4537aa8a4 100644 --- a/src/components/visual-editor/default-theme-styles.scss +++ b/src/components/visual-editor/default-theme-styles.scss @@ -3,10 +3,6 @@ * unavailable or when the editor's theme styles feature is disabled. */ -.gutenberg-kit-visual-editor__post-title-wrapper .wp-block-post-title { - font-size: 20px; // Set reasonable default size for small screens -} - .block-editor-default-block-appender__content { opacity: 0.62; // Match empty post title/rich text placholder style } diff --git a/src/utils/default-editor-styles.scss b/src/utils/default-editor-styles.scss new file mode 100644 index 000000000..97bb6e5ec --- /dev/null +++ b/src/utils/default-editor-styles.scss @@ -0,0 +1,32 @@ +/** + * Default editor styles. + * + * These styles are shown if a theme does not register its own editor style, + * a theme.json file, or has toggled off "Use theme styles" in preferences. + * + * Vendored from the `@wordpress/block-editor` package, which removed the + * stylesheet because the Gutenberg plugin no longer enqueues it and WordPress + * core owns the equivalent styles. + * + * @see https://github.com/WordPress/gutenberg/blob/28c348acdf3e88bbd90f766e66acc6716bcf9103/packages/block-editor/src/default-editor-styles.scss + * @see https://github.com/WordPress/gutenberg/pull/81793 + * @see https://github.com/WordPress/wordpress-develop/blob/db9654e6d386c2c69401b9c77c6ce1ae7460a6e4/src/wp-includes/block-editor.php#L218C4-L218C23 + */ + +@use "@wordpress/base-styles/variables" as *; + +body { + font-family: $default-font; + font-size: 18px; + line-height: 1.5; + --wp--style--block-gap: 2em; +} + +p { + line-height: 1.8; +} + +.editor-post-title { + font-size: 20px; // Set reasonable default size for small screens + font-weight: 800; +} diff --git a/src/utils/editor-settings.js b/src/utils/editor-settings.js index 77976a3e7..03462bc02 100644 --- a/src/utils/editor-settings.js +++ b/src/utils/editor-settings.js @@ -1,10 +1,14 @@ /** * WordPress dependencies */ -import defaultEditorStyles from '@wordpress/block-editor/build-style/default-editor-styles.css?inline'; import { store as editorStore } from '@wordpress/editor'; import { select } from '@wordpress/data'; +/** + * Internal dependencies + */ +import defaultEditorStyles from './default-editor-styles.scss?inline'; + /** * Returns a default editor settings object to use when a site cannot provide * its own editor settings due to lacking the necessary experimental REST API