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

Update TT1 Blocks to use Gutenberg alignments #236

Merged
merged 10 commits into from
Mar 25, 2021
15 changes: 0 additions & 15 deletions tt1-blocks/assets/css/style-editor.css

This file was deleted.

2 changes: 1 addition & 1 deletion tt1-blocks/block-templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<!-- wp:query-loop -->
<!-- wp:post-title {"isLink":true} /-->

<!-- wp:post-content {"align":"full"} /-->
<!-- wp:post-content /-->
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this in place, posts on the front-end extended beyond the edges of the screen. So I've removed it for now. Should probably re-evaluate once I can get the front-end alignments working right in general though.

Copy link
Contributor

@youknowriad youknowriad Mar 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should add { layout: { inherit: true } } to all post content in the templates if they are at the root of templates..


<!-- wp:spacer {"height":70} -->
<div style="height:70px" aria-hidden="true" class="wp-block-spacer"></div>
Expand Down
2 changes: 1 addition & 1 deletion tt1-blocks/block-templates/page-home.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!-- wp:group {"tagName":"main", "align":"full"} -->
<main class="wp-block-group alignfull">
<div class="wp-block-group__inner-container">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question, were we not meant to remove the inner containers too?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's safe to remove yes, the deprecation probably triggers here making sure everything works with or without them but yes, it's better to remove.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I've removed these in af20e47.

<!-- wp:post-content {"align":"full"} /-->
<!-- wp:post-content /-->
</div>
</main>
<!-- /wp:group -->
Expand Down
2 changes: 1 addition & 1 deletion tt1-blocks/block-templates/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<div style="height:70px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->

<!-- wp:post-content {"align":"full"} /-->
<!-- wp:post-content /-->
<!-- wp:post-comments /-->
</div>
</main>
Expand Down
2 changes: 1 addition & 1 deletion tt1-blocks/block-templates/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<div style="height:70px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->

<!-- wp:post-content {"align":"full"} /-->
<!-- wp:post-content /-->

<!-- wp:spacer {"height":70} -->
<div style="height:70px" aria-hidden="true" class="wp-block-spacer"></div>
Expand Down
8 changes: 4 additions & 4 deletions tt1-blocks/experimental-theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@
}
]
},
"layout": {
"contentSize": "610px",
"wideSize": "1240px"
},
"typography": {
"customLineHeight": true,
"fontSizes": [
Expand Down Expand Up @@ -178,10 +182,6 @@
"heading": 1.3,
"page-title": 1.1
},
"responsive": {
"aligndefault-width": "610px",
"alignwide-width": "1240px"
},
"spacing": {
"unit": "20px",
"horizontal": "25px",
Expand Down
3 changes: 1 addition & 2 deletions tt1-blocks/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ function tt1_blocks_setup() {
// Enqueue editor styles.
add_editor_style( array(
'./assets/css/blocks.css',
'./assets/css/style-shared.css',
'./assets/css/style-editor.css',
'./assets/css/style-shared.css'
) );

// Add support for responsive embedded content.
Expand Down
48 changes: 0 additions & 48 deletions tt1-blocks/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,51 +31,3 @@ TT1 Blocks is distributed under the terms of the GNU GPL.
body {
margin: 0;
}

/*--------------------------------------------------------------
# Alignments
--------------------------------------------------------------*/

* {
box-sizing: border-box;
}

.wp-site-blocks,
.wp-block-template-part.alignfull {
padding: 0 var(--wp--custom--spacing--horizontal);
}

.wp-site-blocks * {
margin-left: auto;
margin-right: auto;
}

.wp-site-blocks *:not(.wp-block-post-content):not(.alignfull):not(.alignwide):not([class$="__inner-container"]):not(img) {
max-width: var(--wp--custom--responsive--aligndefault-width);
}

.wp-site-blocks .alignwide {
width: var(--wp--custom--responsive--alignwide-width);
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;
}

.wp-site-blocks .alignfull {
margin: 0 calc(0px - var(--wp--custom--spacing--horizontal));
width: calc(100% + (2 - var(--wp--custom--spacing--horizontal)));
}