Skip to content

Commit

Permalink
Quadrat: add cover pattern (#3676)
Browse files Browse the repository at this point in the history
* Try using svg for block pattern.

* Try mask-image instead.

* move the svg to a before pseudoelement

* refactored the pseudoelements

* fix for the editor interaction when cover block is highlighted

* Add block pattern.

* Use a transparent div instead of svg. Simplify how color of the diamond is set.

* Rotate closer to the design.

* Use background image with svg and mix-blend-mode.

* made block pattern wide aligned

* created exceptions bof black and white

* changes to fit the design, lowered opacity on black and white versions

* Add autoprefixing to Quadrat

* removed error from rebase

* removed unnecessary z-index, linting

* z-index added

* Scope CSS to cover block.

* :: for consistency.

Co-authored-by: Maggie Cabrera <maggie.cabrera@automattic.com>
Co-authored-by: Ben Dwyer <ben@scruffian.com>
  • Loading branch information
3 people committed May 4, 2021
1 parent 1f10d1c commit baa7deb
Show file tree
Hide file tree
Showing 10 changed files with 871 additions and 26 deletions.
3 changes: 3 additions & 0 deletions quadrat/assets/rotated.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions quadrat/assets/theme.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions quadrat/child-experimental-theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@
"color": {
"gradients": [ ],
"palette": [
{
"slug": "black",
"color": "#000000",
"name": "Black"
},
{
"slug": "white",
"color": "#ffffff",
"name": "White"
},
{
"slug": "pink",
"color": "#FFD1D1",
Expand Down
10 changes: 10 additions & 0 deletions quadrat/experimental-theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@
"color": {
"gradients": [],
"palette": [
{
"slug": "black",
"color": "#000000",
"name": "Black"
},
{
"slug": "white",
"color": "#ffffff",
"name": "White"
},
{
"slug": "pink",
"color": "#FFD1D1",
Expand Down
13 changes: 13 additions & 0 deletions quadrat/inc/block-patterns.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,19 @@ function quadrat_register_block_patterns() {
)
);

register_block_pattern(
'quadrat/cover-with-heading',
array(
'title' => __( 'Cover block with heading', 'quadrat' ),
'categories' => array( 'quadrat' ),
'content' => '<!-- wp:cover {"overlayColor":"darker-blue","minHeight":700,"align":"wide","className":"is-style-quadrat-cover-diamond"} -->
<div class="wp-block-cover alignwide has-darker-blue-background-color has-background-dim is-style-quadrat-cover-diamond" style="min-height:700px"><div class="wp-block-cover__inner-container"><!-- wp:heading {"textAlign":"center","textColor":"pink"} -->
<h2 class="has-text-align-center has-pink-color has-text-color">' . esc_html__( 'Episode 3: A Cycle of Emotions', 'quadrat' ) . '</h2>
<!-- /wp:heading --></div></div>
<!-- /wp:cover -->',
)
);

}
}
endif;
Expand Down
8 changes: 4 additions & 4 deletions quadrat/inc/block-styles.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ function quadrat_register_block_styles() {
* Register block styles
*/
register_block_style(
'core/media-text',
'core/cover',
array(
'name' => 'quadrat-example',
'label' => __( 'Example', 'quadrat' ),
'style_handle' => 'quadrat-example',
'name' => 'quadrat-cover-diamond',
'label' => __( 'Diamond', 'quadrat' ),
'style_handle' => 'quadrat-cover-diamond',
)
);
}
Expand Down
Loading

0 comments on commit baa7deb

Please sign in to comment.