-
Notifications
You must be signed in to change notification settings - Fork 360
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
Quadrat: block styles for query block #4171
Changes from all commits
3b2b857
7810ba3
5fa22e6
77d28f1
a84f354
e4b8b3e
e52b609
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
/** | ||
* Blog posts with hover effect. | ||
* | ||
* @package Quadrat | ||
*/ | ||
|
||
return array( | ||
'title' => __( 'List of blog posts', 'quadrat' ), | ||
'categories' => array( 'quadrat' ), | ||
'blockTypes' => array( 'core/query' ), | ||
'content' => '<!-- wp:query {"query":{"perPage":4,"pages":0,"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":false},"displayLayout":{"type":"list","columns":3},"align":"wide","className":"is-style-quadrat-diamond-posts"} --> | ||
<div class="wp-block-query alignwide is-style-quadrat-diamond-posts"><!-- wp:post-template --> | ||
<!-- wp:columns --> | ||
<div class="wp-block-columns"><!-- wp:column {"verticalAlignment":"center"} --> | ||
<div class="wp-block-column is-vertically-aligned-center"><!-- wp:group {"className":"post-meta"} --> | ||
<div class="wp-block-group post-meta"><!-- wp:post-date {"fontSize":"tiny"} /--> | ||
|
||
<!-- wp:post-terms {"term":"category","fontSize":"tiny"} /--></div> | ||
<!-- /wp:group --> | ||
|
||
<!-- wp:post-title {"textAlign":"left","isLink":true,"fontSize":"extra-large"} /--> | ||
|
||
<!-- wp:post-excerpt {"moreText":"Read more","fontSize":"normal"} /--></div> | ||
<!-- /wp:column --> | ||
|
||
<!-- wp:column --> | ||
<div class="wp-block-column"><!-- wp:post-featured-image /--></div> | ||
<!-- /wp:column --></div> | ||
<!-- /wp:columns --> | ||
<!-- /wp:post-template --> | ||
|
||
<!-- wp:query-pagination --> | ||
<div class="wp-block-query-pagination"><!-- wp:query-pagination-previous {"label":"Previous Page"} /--> | ||
|
||
<!-- wp:query-pagination-numbers /--> | ||
|
||
<!-- wp:query-pagination-next {"label":"Next Page"} /--></div> | ||
<!-- /wp:query-pagination --></div> | ||
<!-- /wp:query -->', | ||
); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
.is-style-quadrat-diamond-posts { | ||
.post-meta { | ||
justify-content: flex-start; | ||
} | ||
.wp-block-query-pagination, | ||
.post-meta { | ||
a { | ||
text-decoration: none; | ||
&:hover { | ||
text-decoration: underline; | ||
} | ||
} | ||
} | ||
.wp-block-column { | ||
flex-basis: auto; | ||
@media (min-width: #{ $break-small }) { | ||
&:last-child { | ||
max-width: 300px; | ||
flex-shrink: 0; | ||
} | ||
&:first-child { | ||
padding-right: 2em; | ||
} | ||
} | ||
} | ||
.wp-block-post-featured-image { | ||
width: 300px; | ||
@media (max-width: #{ ($break-small - 1) }) { | ||
width: 100%; | ||
} | ||
Comment on lines
+28
to
+30
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this aligns it to the Columns block media query that collapses the two columns into one. I tried to find a solution without a media query but I couldn't :( |
||
img { | ||
object-fit: cover; | ||
width: 100%; | ||
height: 300px; | ||
} | ||
} | ||
.wp-block-post-template { | ||
li { | ||
display: flex; | ||
align-items: center; | ||
min-height: 400px; | ||
position: relative; | ||
& > * { | ||
flex-basis: 100%; | ||
} | ||
&:before { | ||
content: ""; | ||
background: var(--wp--preset--color--secondary); | ||
width: 375px; | ||
height: 375px; | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
z-index: -1; | ||
opacity:0; | ||
transition: all 0.4s ease-in; | ||
} | ||
&:hover:before { | ||
opacity:1; | ||
} | ||
&:nth-child(2n+1):before { | ||
transform: rotate(16deg) translate(-130px, -20px); | ||
} | ||
&:nth-child(2n+1):hover:before { | ||
transform: rotate(-8deg) translate(-110px, 0); | ||
} | ||
&:nth-child(2n+2):before { | ||
transform: rotate(24deg) translate(-130px, 20px); | ||
} | ||
&:nth-child(2n+2):hover:before { | ||
transform: rotate(16deg) translate(-110px, 40px); | ||
} | ||
Comment on lines
+56
to
+72
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kjellr we went with a very simple animation that we think looks decent, but feel free to tweak the numbers in any way shape or form |
||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
.wp-block-query-loop { | ||
.wp-block-query-loop, | ||
.wp-block-query { | ||
.wp-block-post-title { | ||
font-size: var(--wp--custom--heading--h3--font-size); | ||
} | ||
|
||
// Important is necessary to override any other font size rules applied to the exerpt. | ||
.wp-block-post-excerpt__more-text { | ||
font-size: var(--wp--preset--font-size--tiny) !important; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@scruffian I hope you are proud of me