Skip to content

Commit 8eac65e

Browse files
committed
Merge pull request #129 from material-components/feature/95-latest-posts-pattern
Latest posts pattern
2 parents f92d253 + acc6d61 commit 8eac65e

File tree

4 files changed

+36
-2
lines changed

4 files changed

+36
-2
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
/**
3+
* Copyright 2021 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*
17+
* @package MaterialDesign
18+
*/
19+
20+
/**
21+
* Call to action pattern.
22+
*
23+
* @package MaterialDesign
24+
*/
25+
26+
return [
27+
'title' => __( 'Latest Posts', 'material-design' ),
28+
'content' => '<!-- wp:columns {"verticalAlignment":"center","align":"wide"} --><div class="wp-block-columns alignwide are-vertically-aligned-center"><!-- wp:column {"verticalAlignment":"center","width":"66.66%"} --><div class="wp-block-column is-vertically-aligned-center" style="flex-basis:66.66%"><!-- wp:heading {"level":4} --><h4>Latest Posts</h4><!-- /wp:heading --><!-- wp:paragraph --><p>Perform this action in no time. Satisfaction guaranteed</p><!-- /wp:paragraph --></div><!-- /wp:column --><!-- wp:column {"verticalAlignment":"center","width":"33.33%"} --><div class="wp-block-column is-vertically-aligned-center" style="flex-basis:33.33%"><!-- wp:material/buttons {"align":"right"} --><div class="wp-block-material-buttons alignright"><!-- wp:material/button {"iconPosition":"none","size":"large"} --><div class="wp-block-material-button" id="block-material-button-59"><button class="mdc-button mdc-button--raised is-large"><div class="mdc-button__ripple"></div><span class="mdc-button__label">Get Started</span></button></div><!-- /wp:material/button --></div><!-- /wp:material/buttons --></div><!-- /wp:column --></div><!-- /wp:columns --><!-- wp:material/recent-posts {"contentLayout":"text-under-media","postsToShow":3,"displayCommentsCount":false} /-->',
29+
'viewportWidth' => 800,
30+
'categories' => [ 'material', 'buttons', 'header', 'text', 'columns' ],
31+
'description' => __( 'Call to action pattern.', 'material-design' ),
32+
];

plugin/php/class-block-patterns.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ public function register() {
8686
'hero-section',
8787
'pricing',
8888
'hero-section-image',
89+
'latest-posts',
8990
];
9091

9192
foreach ( $patterns as $pattern ) {

plugin/tests/phpunit/php/class-test-block-patterns.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ class Test_Block_Patterns extends \WP_UnitTestCase {
5151
'hero-section',
5252
'pricing',
5353
'hero-section-image',
54+
'latest-posts',
5455
];
5556

5657
/**

theme/assets/css/src/components/entry-content.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
}
3535
}
3636

37-
.alignleft {
37+
> .alignleft {
3838
margin-left: 1rem;
3939
margin-right: 1rem;
4040
right: auto;
@@ -51,7 +51,7 @@
5151
}
5252
}
5353

54-
.alignright {
54+
> .alignright {
5555
left: auto;
5656
margin-left: 1rem;
5757
margin-right: 1rem;

0 commit comments

Comments
 (0)