From fe175fef60cd3ed0a96d2ef7e2486fad1adf34b9 Mon Sep 17 00:00:00 2001 From: Ben Dwyer Date: Thu, 18 Mar 2021 13:03:22 +0000 Subject: [PATCH 1/5] Update empty theme to use Gutenberg alignments --- emptytheme/block-templates/singular.html | 2 +- emptytheme/experimental-theme.json | 4 ++++ emptytheme/functions.php | 5 +---- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/emptytheme/block-templates/singular.html b/emptytheme/block-templates/singular.html index 69eef0a7..3a8ed432 100644 --- a/emptytheme/block-templates/singular.html +++ b/emptytheme/block-templates/singular.html @@ -2,4 +2,4 @@ - \ No newline at end of file + diff --git a/emptytheme/experimental-theme.json b/emptytheme/experimental-theme.json index 95157e5f..8e3442a9 100644 --- a/emptytheme/experimental-theme.json +++ b/emptytheme/experimental-theme.json @@ -22,6 +22,10 @@ "margin": { "horizontal": "14px" } + }, + "layout": { + "contentSize": "800px", + "wideSize": "1000px" } } }, diff --git a/emptytheme/functions.php b/emptytheme/functions.php index 8d4d2101..047d47c2 100644 --- a/emptytheme/functions.php +++ b/emptytheme/functions.php @@ -31,11 +31,8 @@ function emptytheme_support() { * Enqueue scripts and styles. */ function emptytheme_scripts() { - // Enqueue theme stylesheet. wp_enqueue_style( 'emptytheme-style', get_template_directory_uri() . '/style.css', array(), wp_get_theme()->get( 'Version' ) ); - - // Enqueue alignments stylesheet. - wp_enqueue_style( 'emptytheme-alignments-style', get_template_directory_uri() . '/assets/alignments-front.css', array(), wp_get_theme()->get( 'Version' ) ); } + add_action( 'wp_enqueue_scripts', 'emptytheme_scripts' ); From 1b4839509814069b205d949d2320da4cb6f6c493 Mon Sep 17 00:00:00 2001 From: Ben Dwyer Date: Thu, 18 Mar 2021 13:11:17 +0000 Subject: [PATCH 2/5] remove alignments css --- emptytheme/assets/alignments-front.css | 79 -------------------------- 1 file changed, 79 deletions(-) delete mode 100644 emptytheme/assets/alignments-front.css diff --git a/emptytheme/assets/alignments-front.css b/emptytheme/assets/alignments-front.css deleted file mode 100644 index 15d7cf00..00000000 --- a/emptytheme/assets/alignments-front.css +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Alignments, loaded in the front-end only. - */ - -body { - margin: 0; -} - -* { - box-sizing: border-box; -} - -.wp-site-blocks, -.wp-block-template-part.alignfull { - padding: 0 var(--wp--custom--margin--horizontal); -} - -.wp-site-blocks > *:not(.wp-block-post-content), -.wp-site-blocks .wp-block-post-content > * { - max-width: var(--wp--custom--width--default); - margin-left: auto; - margin-right: auto; -} - -.wp-site-blocks .alignwide { - width: var(--wp--custom--width--wide); - max-width: 100%; - margin-left: auto; - margin-right: auto; -} - -.wp-site-blocks .alignfull { - transform: translateX(calc(0px - var(--wp--custom--margin--horizontal))); - width: calc(100% + (2 * var(--wp--custom--margin--horizontal))); - max-width: calc(100% + (2 * var(--wp--custom--margin--horizontal))); - margin-left: 0; - margin-right: 0; - box-sizing: content-box; -} - -.wp-site-blocks .wp-block-template-part.alignfull { - width: 100%; - max-width: 100%; -} - -.wp-site-blocks .wp-block-columns.alignfull { - width: 100%; - max-width: 100%; -} - -.aligncenter { - text-align: center; -} - -.wp-site-blocks .alignleft { - float: left; - margin-right: 2em; - max-width: 360px; -} - -.wp-site-blocks .alignright { - float: right; - margin-left: 2em; - max-width: 360px; -} - -@media screen and (min-width: 1290px) { - - .wp-site-blocks, - .wp-block-template-part.alignfull { - padding: 0; - } - - .wp-site-blocks .alignfull { - transform: translateX(0px); - width: 100%; - max-width: 100%; - } -} From c9a1ce8817bbb8d4d0e3314c9c4dba8acc97442c Mon Sep 17 00:00:00 2001 From: Ben Dwyer Date: Thu, 18 Mar 2021 13:12:42 +0000 Subject: [PATCH 3/5] Remove unused variables --- emptytheme/experimental-theme.json | 9 --------- 1 file changed, 9 deletions(-) diff --git a/emptytheme/experimental-theme.json b/emptytheme/experimental-theme.json index 8e3442a9..4d1bf8ae 100644 --- a/emptytheme/experimental-theme.json +++ b/emptytheme/experimental-theme.json @@ -14,15 +14,6 @@ "fontFamilies": [ ], "fontSizes": [ ] }, - "custom": { - "width": { - "default": "840px", - "wide": "1100px" - }, - "margin": { - "horizontal": "14px" - } - }, "layout": { "contentSize": "800px", "wideSize": "1000px" From 4c06ca063603bacaad02c5ca4e87fa2ecbd1b476 Mon Sep 17 00:00:00 2001 From: Ben Dwyer Date: Thu, 18 Mar 2021 13:25:32 +0000 Subject: [PATCH 4/5] Inherit the layout inside post content --- emptytheme/block-templates/singular.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/emptytheme/block-templates/singular.html b/emptytheme/block-templates/singular.html index 3a8ed432..59b72cf5 100644 --- a/emptytheme/block-templates/singular.html +++ b/emptytheme/block-templates/singular.html @@ -2,4 +2,6 @@ - + +
+ From 7df570d64a3f965a49a06e225a4ecd0888cfafdb Mon Sep 17 00:00:00 2001 From: Ben Dwyer Date: Fri, 19 Mar 2021 15:01:46 +0000 Subject: [PATCH 5/5] Update theme.json --- emptytheme/block-templates/singular.html | 4 +--- emptytheme/experimental-theme.json | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/emptytheme/block-templates/singular.html b/emptytheme/block-templates/singular.html index 59b72cf5..789f0ff6 100644 --- a/emptytheme/block-templates/singular.html +++ b/emptytheme/block-templates/singular.html @@ -2,6 +2,4 @@ - -
- + diff --git a/emptytheme/experimental-theme.json b/emptytheme/experimental-theme.json index 4d1bf8ae..864f8b85 100644 --- a/emptytheme/experimental-theme.json +++ b/emptytheme/experimental-theme.json @@ -15,8 +15,8 @@ "fontSizes": [ ] }, "layout": { - "contentSize": "800px", - "wideSize": "1000px" + "contentSize": "840px", + "wideSize": "1100px" } } },