Skip to content

Commit 765f3e2

Browse files
author
Mario Aguiar
authored
Merge pull request #122 from material-components/patterns/hero-section
Add hero section pattern
2 parents 0ff6e2c + f15d780 commit 765f3e2

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
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+
* Hero section pattern.
22+
*
23+
* @package MaterialDesign
24+
*/
25+
26+
return [
27+
'title' => __( 'Hero section', 'material-design' ),
28+
'content' => "<!-- wp:group {\"align\":\"wide\"} -->\n<div class=\"wp-block-group alignwide\"><div class=\"wp-block-group__inner-container\"><!-- wp:heading {\"textAlign\":\"center\",\"level\":1} -->\n<h1 class=\"has-text-align-center\">Enormous Heading</h1>\n<!-- /wp:heading -->\n\n<!-- wp:paragraph {\"align\":\"center\",\"fontSize\":\"medium\"} -->\n<p class=\"has-text-align-center has-medium-font-size\">Consectetur adipiscing elit, egestas volutpat fames imperdiet natoque tempor, turpis convallis lectus nascetur primis eget. Lorem ipsum dolor sit amet consectetur adipiscing elit suspendisse purus praesent.</p>\n<!-- /wp:paragraph -->\n\n<!-- wp:material/buttons {\"align\":\"center\"} -->\n<div class=\"wp-block-material-buttons aligncenter\"><!-- wp:material/button {\"iconPosition\":\"none\",\"size\":\"large\"} -->\n<div class=\"wp-block-material-button\" id=\"block-material-button-20\"><button class=\"mdc-button mdc-button--raised is-large\"><div class=\"mdc-button__ripple\"></div><span class=\"mdc-button__label\">Call to action</span></button></div>\n<!-- /wp:material/button --></div>\n<!-- /wp:material/buttons --></div></div>\n<!-- /wp:group -->",
29+
'viewportWidth' => 800,
30+
'categories' => [ 'material', 'buttons', 'header' ],
31+
'description' => __( 'Hero section', 'material-design' ),
32+
];

plugin/php/class-block-patterns.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ public function register() {
8383
'numbers',
8484
'highlights',
8585
'single-feature-extended',
86+
'hero-section',
8687
];
8788

8889
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
@@ -48,6 +48,7 @@ class Test_Block_Patterns extends \WP_UnitTestCase {
4848
'media-grid',
4949
'single-feature',
5050
'single-feature-extended',
51+
'hero-section',
5152
];
5253

5354
/**

0 commit comments

Comments
 (0)