Skip to content

Commit

Permalink
Gutenberg enqueue fixes; added editor.scss
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuaiz committed Jun 10, 2018
1 parent f15c42a commit d6f0f41
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 8 deletions.
37 changes: 31 additions & 6 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ function plate_register_sidebars() {
function new_default_avatar ( $avatar_defaults ) {

//Set the URL where the image file for your avatar is located
$new_avatar_url = get_stylesheet_directory_uri() . '/library/images/custom-gravatar.jpg';
$new_avatar_url = get_stylesheet_directory_uri() . '/library/images/custom-gravatar.png';

// var_dump($new_avatar_url);

Expand Down Expand Up @@ -262,8 +262,7 @@ function plate_comments( $comment, $args, $depth ) {

<?php // </li> is added by WordPress automatically ?>

<?php
} // don't remove this bracket!
<?php } // don't remove this bracket!


/*
Expand Down Expand Up @@ -435,16 +434,42 @@ function plate_scripts_and_styles() {
}


/*********************
GUTENBERG ENQUEUES
These are kept out of the main enqueue
function in case you don't need them.
*********************/

/**
*
* Gutenberg Editor Styles
*
* Enqueue block editor style for Gutenberg
* Alternatively you can uncomment the gutenberg
* import in style.scss.
* This applies to the admin editor *only*,
* (e.g. not on the front end);
*
*/

add_action( 'enqueue_block_editor_assets', 'plate_block_editor_styles' );

function plate_block_editor_styles() {
wp_enqueue_style( 'plate-block-editor-styles', get_theme_file_uri( '/library/css/gutenberg.css' ), false, '1.0', 'all' );

}

add_action( 'enqueue_block_editor_assets', 'plate_block_editor_styles' );
/**
* Gutenberg Front End Styles
*
* Enqueue front end styles for Gutenberg.
*
*/
add_action( 'enqueue_block_assets', 'plate_gutenberg_styles' );

function plate_gutenberg_styles() {
wp_enqueue_style( 'plate-gutenbers-styles', get_theme_file_uri( '/library/css/gutenberg.css' ), false, '1.0', 'all' );

}

/****************************************
* REMOVE WP EXTRAS & DEQUEUEING STUFFS *
Expand Down
3 changes: 3 additions & 0 deletions library/css/ie.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion library/css/ie.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion library/css/style.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions library/scss/breakpoints/_1030up.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ Stylesheet: Desktop Stylsheet
This is the desktop size. It's larger than an iPad so it will only
be seen on the Desktop.
At this breakpoint you can start setting things like max-width for
your content. Or go full-width. Like Nas said: "The world is yours!."
******************************************************************/

#inner-header, #inner-footer {
Expand Down
13 changes: 13 additions & 0 deletions library/scss/partials/_editor.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/******************************************************************
Site Name:
Author:
Stylesheet: Gutenberg Editor Stylesheet
This stylesheet is enqueued in functions.php and *only* affects
the Gutenberg editor in the WP admin.
For styles that apply to both the editor *and* the front end, use
the _gutenberg.scss stylesheet which already has some default styles.
******************************************************************/

0 comments on commit d6f0f41

Please sign in to comment.