Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Gutenberg support #1554

Merged
merged 36 commits into from
Nov 8, 2018
Merged

Add Gutenberg support #1554

merged 36 commits into from
Nov 8, 2018

Conversation

benlk
Copy link
Collaborator

@benlk benlk commented Oct 31, 2018

Changes:

non-gutenberg:

Testing:

  • tests against https://richtabor.com/gutenberg-block-unit-test/ to make sure every default block is appropriately styled
  • works outside of Gutenberg
  • works in 5.0-beta3
  • unit tests pass, even if we don't have Gutenberg installed in the test suite yet

Why

Because WordPress 5.0 is imminent, and we should prepare for immanentizing the eschaton.

Addresses:

@benlk benlk added this to the 0.6 - Performance & SEO milestone Oct 31, 2018
@benlk benlk self-assigned this Oct 31, 2018
@benlk benlk changed the title Gutenberg support PR Add Gutenberg support Oct 31, 2018
@benlk
Copy link
Collaborator Author

benlk commented Nov 7, 2018

With this in the tests/bootstrap.php:

		$plugins = get_option( 'active_plugins' );
		$plugins[] = 'gutenberg/gutenberg.php';
		$ret = update_option( 'active_plugins', $plugins );
		error_log(var_export( $ret, true));
		error_log(var_export( $plugins, true));

And this in the logs:

Running as single site... To run multisite, use -c tests/phpunit/multisite.xml
true
array (
  0 => 'gutenberg/gutenberg.php'
)

Still getting this error:

1) EnqueueTestFunctions_Gutenberg::test_activate_gutenberg
Attempted to activate Gutenberg, but it looks like the function `register_block_type()` was not defined. Did that function name change? It is what we use to decide whether to enqueue css/gutenberg.css
Failed asserting that false is true.
/tmp/wordpress/src/wp-content/themes/largo/tests/inc/test-enqueue.php:68

So I'm going to comment out the pre-5.0 GUTENBERG tests for now, and let 5.0 stand for all Gutenberg versions for now.

@benlk
Copy link
Collaborator Author

benlk commented Nov 8, 2018

Okay, calling it a merge. We can revisit some of these styles more later, in response to peoples' feedback.

I suspect we're going to be asked to make the buttons bigger, and do something about pull quote formatting.

Child themes will need to enqueue their own editor stylesheets if they want fancy fonts there as well.

Gutenberg editor styles are added thusly in Largo in the largo_setup() function hooked on 'after_setup_theme':

// Gutenberg support for editor styles; @link https://github.com/WordPress/gutenberg/pull/9008
add_theme_support( 'editor-styles' );
add_editor_style('/css/gutenberg' . $suffix . '.css');

@benlk benlk merged commit 9a95d44 into 0.5-dev Nov 8, 2018
@benlk benlk deleted the gutenberg-css branch November 8, 2018 04:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant