Skip to content

Commit

Permalink
Implement layout from config
Browse files Browse the repository at this point in the history
  • Loading branch information
aristath committed Mar 19, 2021
1 parent c861ca7 commit b03f867
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 50 deletions.
10 changes: 9 additions & 1 deletion block-templates/404.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
<!-- wp:template-part {"slug":"header"} /-->

<!-- wp:group {"tagName":"main","layout":{"inherit":true}} -->
<div class="wp-block-group"><div class="wp-block-group__inner-container">

<!-- wp:heading {"level":1,"fontSize":"enormous"} -->
<h1>404</h1>
<!-- /wp:heading -->
Expand All @@ -6,4 +11,7 @@ <h1>404</h1>
<p>We could not find the content you requested.</p>
<!-- /wp:paragraph -->

<!-- wp:search {"label":"Search","buttonText":"Search"} /-->
<!-- wp:search {"label":"Search","buttonText":"Search"} /-->

</div>
<!-- /wp:group -->
2 changes: 1 addition & 1 deletion block-templates/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- wp:template-part {"slug":"header","tagName":"header"} /-->

<!-- wp:group {"tagName":"main"} -->
<!-- wp:group {"tagName":"main","layout":{"inherit":true}} -->
<div class="wp-block-group"><div class="wp-block-group__inner-container"><!-- wp:query {"queryId":0,"query":{"perPage":10,"pages":0,"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":true}} -->
<!-- wp:query-loop -->
<!-- wp:post-title {"isLink":true} /-->
Expand Down
4 changes: 4 additions & 0 deletions block-templates/single.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<!-- wp:template-part {"slug":"header"} /-->

<!-- wp:group {"tagName":"main","layout":{"inherit":true}} -->
<div class="wp-block-group"><div class="wp-block-group__inner-container">
<!-- wp:post-title {"level":1} /-->

<!-- wp:post-featured-image /-->
Expand All @@ -11,5 +13,7 @@
<!-- wp:post-comments /-->

<!-- wp:post-comments-form /-->
</div>
<!-- /wp:group -->

<!-- wp:template-part {"slug":"footer"} /-->
4 changes: 4 additions & 0 deletions experimental-theme.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"settings": {
"defaults": {
"layout": {
"contentSize": "var(--wp--custom--content--default-width))",
"wideSize": "var(--wp--custom--content--wide-width))"
},
"custom": {
"typo": {
"rootSize": 16,
Expand Down
3 changes: 0 additions & 3 deletions styles/layout-editor.css

This file was deleted.

46 changes: 1 addition & 45 deletions styles/layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,6 @@
padding: 0 var(--wp--custom--content--padding);
}

.wp-site-blocks > *:not(.wp-block-post-content),
.wp-site-blocks .wp-block-post-content > * {
max-width: var(--wp--custom--content--default-width);
margin-left: auto;
margin-right: auto;
}

.wp-site-blocks .alignwide {
width: var(--wp--custom--content--wide-width);
max-width: 100%;
margin-left: auto;
margin-right: auto;
}

.wp-site-blocks .alignfull {
transform: translateX(calc(0px - var(--wp--custom--content--padding)));
width: calc(100% + 2 * var(--wp--custom--content--padding));
Expand All @@ -27,29 +13,6 @@
text-align: center;
}

.alignleft,
.alignright,
.wp-site-blocks .wp-block-post-content .alignleft,
.wp-site-blocks .wp-block-post-content .alignright {
max-width: calc(var(--wp--custom--content--default-width) / 2);
}

.alignleft,
.wp-site-blocks .wp-block-post-content .alignleft {
float: left;

/* margin-left: calc(50% - var(--wp--custom--content--default-width) / 2); */
margin-right: 1em;
}

.alignright,
.wp-site-blocks .wp-block-post-content .alignright {
float: right;

/* margin-right: calc(50% - var(--wp--custom--content--default-width) / 2); */
margin-left: 1em;
}

.has-background {
padding: var(--wp--custom--content--padding);
}
Expand All @@ -70,13 +33,6 @@ Start fix for bug: https://github.com/WordPress/gutenberg/issues/25610
box-sizing: content-box;
}

.wp-site-blocks .wp-block-template-part > .wp-block-template-part:not(.alignfull) {
max-width: var(--wp--custom--content--default-width);
transform: translateX(calc(0px + var(--wp--custom--content--padding)));
margin-left: auto;
margin-right: auto;
}

.wp-site-blocks .wp-block-template-part > .wp-block-template-part.alignfull {
transform: none;
}
Expand All @@ -87,4 +43,4 @@ Start fix for bug: https://github.com/WordPress/gutenberg/issues/25610
}
/*
End fix for bug: https://github.com/WordPress/gutenberg/issues/25610
*/
*/

0 comments on commit b03f867

Please sign in to comment.