windhamdavid 4 years ago
parent
commit
d9482fdfc4
3 changed files with 25 additions and 13 deletions
  1. 10 0
      css/custom.css
  2. 8 1
      css/custom.scss
  3. 7 12
      functions.php

+ 10 - 0
css/custom.css

@@ -15,6 +15,16 @@ a {
   transition: background-color 0.2s ease-in-out;
   transition: background-color 0.2s ease-in-out;
   white-space: nowrap; }
   white-space: nowrap; }
 
 
+.wp-block {
+  max-width: 992px; }
+
+.wp-block[data-align="full"] {
+  max-width: none; }
+
+.editor-post-title__block .editor-post-title__input, .edit-post-visual-editor, .edit-post-visual-editor p {
+  font-family: 'Lato', Helvetica, Arial, sans-serif;
+  font-weight: 300; }
+
 /*!
 /*!
  * Bootstrap v5.0.0-beta1 (https://getbootstrap.com/)
  * Bootstrap v5.0.0-beta1 (https://getbootstrap.com/)
  * Copyright 2011-2020 The Bootstrap Authors
  * Copyright 2011-2020 The Bootstrap Authors

+ 8 - 1
css/custom.scss

@@ -14,7 +14,7 @@ $indigo: #343C70;
 $blue: #38537A;
 $blue: #38537A;
 $blue-100:#38537A;
 $blue-100:#38537A;
 
 
-$font-family-sans-serif:  'Lato', Helvetica, Arial, sans-serif !default;
+$font-family-sans-serif: 'Lato', Helvetica, Arial, sans-serif !default;
 
 
 a {
 a {
   color: var(--bs-success);
   color: var(--bs-success);
@@ -49,6 +49,13 @@ a {
 	transition: background-color 0.2s ease-in-out;
 	transition: background-color 0.2s ease-in-out;
 	white-space: nowrap;
 	white-space: nowrap;
 }
 }
+.wp-block{max-width:992px;}
+.wp-block[data-align="wide"]{}
+.wp-block[data-align="full"]{max-width:none;}
+.editor-post-title__block .editor-post-title__input,.edit-post-visual-editor, .edit-post-visual-editor p {
+  font-family: 'Lato', Helvetica, Arial, sans-serif;
+  font-weight:300;
+}
 
 
 
 
 @import '../node_modules/bootstrap/scss/mixins';
 @import '../node_modules/bootstrap/scss/mixins';

+ 7 - 12
functions.php

@@ -41,7 +41,6 @@ function boot23_setup() {
     'caption',
     'caption',
   ));
   ));
   add_theme_support( 'customize-selective-refresh-widgets' );
   add_theme_support( 'customize-selective-refresh-widgets' );
-  add_theme_support( 'editor-styles' );
 }
 }
 add_action( 'after_setup_theme', 'boot23_setup' );
 add_action( 'after_setup_theme', 'boot23_setup' );
 
 
@@ -95,23 +94,19 @@ add_action( 'widgets_init', 'boot23_widgets_init' );
 ######## Gutenberg Editor #########
 ######## Gutenberg Editor #########
 ***********************************/
 ***********************************/
 
 
-function boot23_add_editor_styles() {
-  add_editor_style([
-    'css/custom.css',
-    'style.css'
-  ] );
-}
-add_action( 'admin_init', 'boot23_add_editor_styles' );
-
 function boot23_gutenberg_scripts() {
 function boot23_gutenberg_scripts() {
 	wp_enqueue_script( 'hp-editor', get_stylesheet_directory_uri() . '/js/editor.js', array( 'wp-blocks', 'wp-dom' ), filemtime( get_stylesheet_directory() . '/js/editor.js' ), true );
 	wp_enqueue_script( 'hp-editor', get_stylesheet_directory_uri() . '/js/editor.js', array( 'wp-blocks', 'wp-dom' ), filemtime( get_stylesheet_directory() . '/js/editor.js' ), true );
 }
 }
 add_action( 'enqueue_block_editor_assets', 'boot23_gutenberg_scripts' );
 add_action( 'enqueue_block_editor_assets', 'boot23_gutenberg_scripts' );
 
 
-function boot23_gutenberg_style() {
-    echo '<style>.wp-block{max-width:992px;}.wp-block[data-align="wide"]{}.wp-block[data-align="full"]{max-width:none;}.editor-post-title__block .editor-post-title__input,.edit-post-visual-editor, .edit-post-visual-editor p{font-family: Helvetica, Arial, sans-serif;}</style>';
+function boot23_add_editor_styles() {
+  add_theme_support( 'editor-styles' );
+  add_editor_style([
+    'css/custom.css',
+    'style.css'
+  ]);
 }
 }
-add_action('admin_head', 'boot23_gutenberg_style');
+add_action( 'after_setup_theme', 'boot23_add_editor_styles' );
 
 
 function boot23_gutenberg_filter_block( $block_content, $block ) {
 function boot23_gutenberg_filter_block( $block_content, $block ) {
 	$block_content = str_replace(
 	$block_content = str_replace(