Przeglądaj źródła

Add all CSS to the editor styles, add a rule to make the post content white, and reference the files locally

Ben Dwyer 4 lat temu
rodzic
commit
85e2bd3307
2 zmienionych plików z 15 dodań i 0 usunięć
  1. 4 0
      penscratch-2/css/editor-blocks.css
  2. 11 0
      penscratch-2/functions.php

+ 4 - 0
penscratch-2/css/editor-blocks.css

@@ -19,6 +19,10 @@ Description: Used to style Gutenberg Blocks in the editor.
 1.0 General Typography
 --------------------------------------------------------------*/
 
+body {
+	background: #fff;
+}
+
 .block-editor-block-list__block,
 .editor-default-block-appender textarea.editor-default-block-appender__content {
 	font-family: "Roboto Slab", Georgia, Times, serif;

+ 11 - 0
penscratch-2/functions.php

@@ -227,6 +227,17 @@ function penscratch_2_scripts() {
 }
 add_action( 'wp_enqueue_scripts', 'penscratch_2_scripts' );
 
+/**
+ * Enqueue editor styles for Gutenberg
+ */
+function penscratch_2_block_editor_styles() {
+	// Block styles.
+	wp_enqueue_style( 'penscratch-2-block-editor-style', get_theme_file_uri( '/css/editor-blocks.css' ) );
+	// Fonts.
+	wp_enqueue_style( 'penscratch-2-fonts-url', penscratch_2_fonts_url(), array(), null );
+}
+add_action( 'enqueue_block_editor_assets', 'penscratch_2_block_editor_styles' );
+
 /**
  * Register Google Fonts
  */