From 104e25b627a2cadd9c3fc74431983f6a2884329f Mon Sep 17 00:00:00 2001 From: laurelfulford Date: Tue, 6 Nov 2018 01:00:58 +0000 Subject: [PATCH] Twenty Eleven: Fix issues with theme's Gutenberg support. A handful of issues were missed in Twenty Eleven's Gutenberg support, added in #45039. This commit includes the following fixes: * Center text and bullets in list-based widget blocks when block itself is centered. * Include non "image" variations of the Cover block classes `.wp-block-cover` and `.wp-block-cover-text` in the styles. * Add spacing underneath the Media & Text block, but make sure final paragraph in the block doesn't add too much space. * Simplify selectors used to set editor width to just `.wp-block`. * Prevent margin from theme's editor-style.css from interfering with editor alignment. Props pento, davidakennedy. Fixes #45239. git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43870 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-content/themes/twentyeleven/blocks.css | 38 +++++++++++++++++-- .../themes/twentyeleven/editor-blocks.css | 32 ++++++++++++---- 2 files changed, 59 insertions(+), 11 deletions(-) diff --git a/src/wp-content/themes/twentyeleven/blocks.css b/src/wp-content/themes/twentyeleven/blocks.css index e448ddeaae..c3b2089d9c 100644 --- a/src/wp-content/themes/twentyeleven/blocks.css +++ b/src/wp-content/themes/twentyeleven/blocks.css @@ -130,18 +130,21 @@ p.has-drop-cap:not(:focus)::first-letter { width: 100%; } -/* Cover Image */ +/* Cover */ -.wp-block-cover-image.aligncenter { +.wp-block-cover-image.aligncenter, +.wp-block-cover.aligncenter { clear: both; display: flex; } -.wp-block-cover-image.alignleft { +.wp-block-cover-image.alignleft, +.wp-block-cover.alignleft { margin-right: 1.625em; } -.wp-block-cover-image.alignright { +.wp-block-cover-image.alignright, +.wp-block-cover.alignright { margin-left: 1.625em; } @@ -260,10 +263,37 @@ p.has-drop-cap:not(:focus)::first-letter { max-width: 100%; } +/* Media & Text */ + +.wp-block-media-text { + margin-bottom: 1.625em; +} + +.wp-block-media-text *:last-child { + margin-bottom: 0; +} + /*-------------------------------------------------------------- 5.0 Blocks - Widgets --------------------------------------------------------------*/ +/* Archives, Categories & Latest Posts */ + +.wp-block-archives.aligncenter, +.wp-block-categories.aligncenter, +.wp-block-latest-posts.aligncenter { + list-style-position: inside; + margin-left: 2.5em; + text-align: center; +} + +.rtl .wp-block-archives.aligncenter, +.rtl .wp-block-categories.aligncenter, +.rtl .wp-block-latest-posts.aligncenter { + margin-left: 0; + margin-right: 2.5em; +} + /* Latest Comments */ .wp-block-latest-comments { diff --git a/src/wp-content/themes/twentyeleven/editor-blocks.css b/src/wp-content/themes/twentyeleven/editor-blocks.css index 65ad9f1a57..88935f1949 100644 --- a/src/wp-content/themes/twentyeleven/editor-blocks.css +++ b/src/wp-content/themes/twentyeleven/editor-blocks.css @@ -72,10 +72,12 @@ Description: Used to style Gutenberg Blocks in the editor. /* Main column width */ -body.gutenberg-editor-page .edit-post-visual-editor .editor-post-title__block, -body.gutenberg-editor-page .edit-post-visual-editor .editor-default-block-appender, -body.gutenberg-editor-page .edit-post-visual-editor .editor-block-list__block { - max-width: 614px; +.editor-styles-wrapper { + max-width: 100% !important; /* Override where editor-style.css is affecting this. */ +} + +.wp-block { + max-width: 614px; /* 584px + 30px to account for padding */ } /* Link styles */ @@ -288,10 +290,10 @@ p.has-drop-cap:not(:focus)::first-letter { font-size: 16px; } +/* Cover */ -/* Cover Image */ - -.edit-post-visual-editor .editor-block-list__block .wp-block-cover-image p.wp-block-cover-image-text { +.edit-post-visual-editor .editor-block-list__block .wp-block-cover-image p.wp-block-cover-image-text, +.edit-post-visual-editor .editor-block-list__block .wp-block-cover p.wp-block-cover-text { font-size: 30px; line-height: 37.5px; } @@ -385,10 +387,26 @@ p.has-drop-cap:not(:focus)::first-letter { text-shadow: 0 -1px 0 rgba(0,0,0,0.3); } +/* Media & Text */ + +.wp-block-media-text *:last-child { + margin-bottom: 0; +} + /*-------------------------------------------------------------- 6.0 Blocks - Widgets --------------------------------------------------------------*/ +/* Archives, Categories & Latest Posts */ + +[data-align="center"] .wp-block-archives ul, +[data-align="center"] .wp-block-categories ul, +[data-align="center"] .wp-block-latest-posts ul { + list-style-position: inside; + margin-left: 2.5em; + text-align: center; +} + /* Latest Comments */ .wp-block-latest-comments {