Skip to content
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

Merged
merged 7 commits into from
Jul 7, 2021

Conversation

MaggieCabrera
Copy link
Contributor

@MaggieCabrera MaggieCabrera commented Jul 6, 2021

Changes proposed in this Pull Request:

This PR includes a new block style for the Query block and the associated block pattern. The design has a "Load more posts" button but I've decided to maintain the current query navigation design since we don't have the option for a one button solution within the Query block right now.

There are a few known issues that need to be solved in Gutenberg but I don't think they block this PR from merging in its current state:

ezgif-7-1001994f4c3b

Related issue(s):

Fixes #3644

@MaggieCabrera MaggieCabrera marked this pull request as ready for review July 6, 2021 17:37
@MaggieCabrera MaggieCabrera self-assigned this Jul 6, 2021
@MaggieCabrera MaggieCabrera requested a review from a team July 6, 2021 17:37
@MaggieCabrera
Copy link
Contributor Author

@kjellr and @beafialho this is ready for your review as well

Comment on lines -21 to +28
'headline-button',
'media-text-button',
'latest-episodes',
'episode',
'cover-with-heading',
'episode',
'headline-button',
'headlines-and-buttons',
'query-diamond',
'latest-episodes',
'listen-to-the-podcast',
'media-text-button',
Copy link
Contributor Author

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

Comment on lines +23 to +25
@media (max-width: #{ ($break-small - 1) }) {
width: 100%;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The 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 :(

Comment on lines +51 to +67
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);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The 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

@kjellr
Copy link
Contributor

kjellr commented Jul 7, 2021

This looks great, @MaggieCabrera! I pushed a couple commits with some minor adjustments:

  • I adjusted the responsive styles so that the featured image is 100% width on small screens.
  • I made the max size of the featured image slightly smaller, and adjusted the text width of the excerpt so it doesn't get too long.
  • I changed the font size of the "read more" text (there's currently no way to modify that independently of the rest of the body text, so this required an !important 😞)
  • I renamed the pattern to avoid use of the word "hover". Folks on mobile won't generally know the hover exists anyway, and I think it's fine to just call this a list of posts.
  • I added a blockTypes prop so this pattern will show up in the Query Loop's pattern carousel.

The only issue I'm seeing is the issue you referenced above, which unfortunately impacts the preview. But since that's an upstream bug, I think this is ready to go!

Desktop Mobile
Screen Shot 2021-07-07 at 9 28 52 AM Screen Shot 2021-07-07 at 9 29 34 AM

@MaggieCabrera
Copy link
Contributor Author

Since this is an opt-in feature I'm bringing this in and we can iterate if we find it needs more work

@MaggieCabrera MaggieCabrera merged commit 0ce22c2 into trunk Jul 7, 2021
@scruffian scruffian deleted the quadrat-query-block-styles branch July 7, 2021 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Quadrat: Hover effect
2 participants