Skip to content

Commit

Permalink
Merge pull request #236 from WordPress/update/tt1-blocks-alignments
Browse files Browse the repository at this point in the history
Update TT1 Blocks to use Gutenberg alignments
  • Loading branch information
kjellr authored Mar 25, 2021
2 parents 95e33c5 + 28f2782 commit c234d5d
Show file tree
Hide file tree
Showing 11 changed files with 82 additions and 155 deletions.
21 changes: 0 additions & 21 deletions tt1-blocks/assets/css/blocks.css
Original file line number Diff line number Diff line change
Expand Up @@ -184,23 +184,6 @@ hr[style*="text-align: right"],
border-right-color: var(--wp--preset--color--dark-gray);
}

hr:not(.is-style-wide):not(.is-style-dots),
.wp-block-separator:not(.is-style-wide):not(.is-style-dots) {
max-width: var(--wp--custom--responsive--aligndefault-width);
}

.wp-block[data-align="wide"] .wp-block-separator:not(.is-style-wide):not(.is-style-dots),
hr.alignwide:not(.is-style-wide):not(.is-style-dots),
.wp-block-separator.alignwide:not(.is-style-wide):not(.is-style-dots) {
max-width: 100%;
}

.wp-block[data-align="full"] .wp-block-separator:not(.is-style-wide):not(.is-style-dots),
hr.alignfull:not(.is-style-wide):not(.is-style-dots),
.wp-block-separator.alignfull:not(.is-style-wide):not(.is-style-dots) {
max-width: inherit;
}

hr.is-style-twentytwentyone-separator-thick,
.wp-block-separator.is-style-twentytwentyone-separator-thick {
border-bottom-width: 3px;
Expand All @@ -210,10 +193,6 @@ hr.is-style-twentytwentyone-separator-thick,
border-bottom: none;
}

.wp-block-separator.is-style-dots.alignwide {
width: 100%;
}

.wp-block-separator.is-style-dots > hr {
display: none;
}
Expand Down
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-template-parts/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@
<p class="has-text-align-right">Proudly powered by <a href="https://wordpress.org/">WordPress</a>.</p>
<!-- /wp:paragraph --></div>
<!-- /wp:column --></div>
<!-- /wp:columns -->
<!-- /wp:columns -->
42 changes: 20 additions & 22 deletions tt1-blocks/block-templates/404.html
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
<!-- wp:template-part {"slug":"header","align":"full","tagName":"header","className":"site-header"} /-->
<!-- wp:template-part {"slug":"header","tagName":"header","className":"site-header","layout":{"inherit":true}} /-->

<!-- wp:group {"tagName":"main", "align":"full"} -->
<main class="wp-block-group alignfull">
<div class="wp-block-group__inner-container">
<!-- wp:heading {"level":1,"align":"wide"} -->
<h1 class="alignwide">Nothing Here</h1>
<!-- /wp:heading -->
<!-- wp:group {"tagName":"main","layout":{"inherit":true}} -->
<main class="wp-block-group">
<!-- wp:heading {"level":1,"align":"wide"} -->
<h1 class="alignwide">Nothing Here</h1>
<!-- /wp:heading -->

<!-- wp:separator {"align":"wide","className":"is-style-twentytwentyone-separator-thick"} -->
<hr class="wp-block-separator alignwide is-style-twentytwentyone-separator-thick"/>
<!-- /wp:separator -->
<!-- wp:separator {"align":"wide","className":"is-style-twentytwentyone-separator-thick"} -->
<hr class="wp-block-separator alignwide is-style-twentytwentyone-separator-thick"/>
<!-- /wp:separator -->

<!-- wp:spacer {"height":70} -->
<div style="height:70px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->
<!-- wp:spacer {"height":70} -->
<div style="height:70px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->

<!-- wp:paragraph -->
<p>It looks like nothing was found at this location. Maybe try a search?</p>
<!-- /wp:paragraph -->
<!-- wp:paragraph -->
<p>It looks like nothing was found at this location. Maybe try a search?</p>
<!-- /wp:paragraph -->

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

<!-- wp:spacer {"height":70} -->
<div style="height:70px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->
</div>
<!-- wp:spacer {"height":70} -->
<div style="height:70px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->
</main>
<!-- /wp:group -->

<!-- wp:template-part {"slug":"footer","align":"full","tagName":"footer","className":"site-footer"} /-->
<!-- wp:template-part {"slug":"footer","tagName":"footer","className":"site-footer","layout":{"inherit":true}} /-->
42 changes: 23 additions & 19 deletions tt1-blocks/block-templates/index.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
<!-- wp:template-part {"slug":"header","align":"full","tagName":"header","className":"site-header"} /-->
<!-- wp:template-part {"slug":"header","tagName":"header","className":"site-header","layout":{"inherit":true}} /-->

<!-- wp:group {"tagName":"main", "align":"full"} -->
<main class="wp-block-group alignfull">
<div class="wp-block-group__inner-container">
<!-- wp:group {"tagName":"main"} -->
<main class="wp-block-group">
<!-- wp:query {"queryId":1,"query":{"perPage":"10","pages":"100","offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","sticky":"","inherit":true}} -->
<!-- wp:query-loop -->

<!-- wp:query {"queryId":1,"query":{"perPage":"10","pages":"100","offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","sticky":"","inherit":true}} -->

<!-- wp:query-loop -->
<!-- wp:group {"layout":{"inherit":true}} -->
<div class="wp-block-group">
<!-- wp:post-title {"isLink":true} /-->
</div>
<!-- /wp:group -->

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

<!-- wp:group {"layout":{"inherit":true}} -->
<div class="wp-block-group">
<!-- wp:spacer {"height":70} -->
<div style="height:70px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->
Expand All @@ -36,23 +40,23 @@
<!-- wp:spacer {"height":70} -->
<div style="height:70px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->
</div>
<!-- /wp:group -->
<!-- /wp:query-loop -->

<!-- /wp:query-loop -->

<!-- wp:group {"layout":{"inherit":true}} -->
<div class="wp-block-group">
<!-- wp:query-pagination -->
<div class="wp-block-query-pagination">
<!-- wp:query-pagination-previous /-->
<div class="wp-block-query-pagination"><!-- wp:query-pagination-previous /-->

<!-- wp:query-pagination-numbers /-->
<!-- wp:query-pagination-numbers /-->

<!-- wp:query-pagination-next /-->
</div>
<!-- wp:query-pagination-next /--></div>
<!-- /wp:query-pagination -->

<!-- /wp:query -->

</div>
<!-- /wp:group -->
<!-- /wp:query -->
</main>
<!-- /wp:group -->

<!-- wp:template-part {"slug":"footer","align":"full","tagName":"footer","className":"site-footer"} /-->
<!-- wp:template-part {"slug":"footer","tagName":"footer","className":"site-footer","layout":{"inherit":true}} /-->
13 changes: 6 additions & 7 deletions tt1-blocks/block-templates/page-home.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<!-- wp:template-part {"slug":"header","align":"full","tagName":"header","className":"site-header"} /-->
<!-- wp:template-part {"slug":"header","tagName":"header","className":"site-header","layout":{"inherit":true}} /-->

<!-- wp:group {"tagName":"main", "align":"full"} -->
<main class="wp-block-group alignfull">
<div class="wp-block-group__inner-container">
<!-- wp:post-content {"align":"full"} /-->
</div>
<!-- wp:group {"tagName":"main"} -->
<main class="wp-block-group">
<!-- wp:post-content {"layout":{"inherit":true}} /-->
</main>
<!-- /wp:group -->
<!-- wp:template-part {"slug":"footer","align":"full","tagName":"footer","className":"site-footer"} /-->

<!-- wp:template-part {"slug":"footer","tagName":"footer","className":"site-footer","layout":{"inherit":true}} /-->
19 changes: 13 additions & 6 deletions tt1-blocks/block-templates/page.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<!-- wp:template-part {"slug":"header","align":"full","tagName":"header","className":"site-header"} /-->
<!-- wp:template-part {"slug":"header","tagName":"header","className":"site-header","layout":{"inherit":true}} /-->

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

<!-- wp:separator {"align":"wide","className":"is-style-twentytwentyone-separator-thick"} -->
Expand All @@ -12,11 +13,17 @@
<!-- wp:spacer {"height":70} -->
<div style="height:70px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->
</div>
<!-- /wp:group -->

<!-- wp:post-content {"layout":{"inherit":true}} /-->

<!-- wp:post-content {"align":"full"} /-->
<!-- wp:group {"layout":{"inherit":true}} -->
<div class="wp-block-group">
<!-- wp:post-comments /-->
</div>
<!-- /wp:group -->
</main>
<!-- /wp:group -->

<!-- wp:template-part {"slug":"footer","align":"full","tagName":"footer","className":"site-footer"} /-->
<!-- wp:template-part {"slug":"footer","tagName":"footer","className":"site-footer","layout":{"inherit":true}} /-->
21 changes: 14 additions & 7 deletions tt1-blocks/block-templates/single.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<!-- wp:template-part {"slug":"header","align":"full","tagName":"header","className":"site-header"} /-->
<!-- wp:template-part {"slug":"header","tagName":"header","className":"site-header","layout":{"inherit":true}} /-->

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

<!-- wp:separator {"align":"wide","className":"is-style-twentytwentyone-separator-thick"} -->
Expand All @@ -12,9 +13,13 @@
<!-- wp:spacer {"height":70} -->
<div style="height:70px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->
</div>
<!-- /wp:group -->

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

<!-- wp:group {"layout":{"inherit":true}} -->
<div class="wp-block-group">
<!-- wp:spacer {"height":70} -->
<div style="height:70px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->
Expand All @@ -40,9 +45,11 @@
<!-- wp:spacer {"height":70} -->
<div style="height:70px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->

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

<!-- wp:template-part {"slug":"footer","align":"full","tagName":"footer","className":"site-footer"} /-->
<!-- wp:template-part {"slug":"footer","tagName":"footer","className":"site-footer","layout":{"inherit":true}} /-->
8 changes: 4 additions & 4 deletions tt1-blocks/experimental-theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@
}
]
},
"layout": {
"contentSize": "610px",
"wideSize": "1240px"
},
"typography": {
"customLineHeight": true,
"fontSizes": [
Expand Down Expand Up @@ -180,10 +184,6 @@
"heading": 1.3,
"page-title": 1.1
},
"responsive": {
"aligndefault-width": "610px",
"alignwide-width": "1240px"
},
"spacing": {
"unit": "20px",
"horizontal": "25px",
Expand Down
6 changes: 1 addition & 5 deletions tt1-blocks/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,13 @@ function tt1_blocks_setup() {
// Add support for Block Styles.
add_theme_support( 'wp-block-styles' );

// Add support for full and wide align images.
add_theme_support( 'align-wide' );

// Add support for editor styles.
add_theme_support( 'editor-styles' );

// 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)));
}

0 comments on commit c234d5d

Please sign in to comment.