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

Latest News block: Add support for cards style and popular categories #489

Merged
merged 2 commits into from
Oct 26, 2023

Conversation

adamwoodnz
Copy link
Contributor

@adamwoodnz adamwoodnz commented Oct 25, 2023

Closes #448

Adds a Cards style variation and 'showCategories' attribute to the block to support the design for Developer.

Screenshots

Editor

Screenshot 2023-10-25 at 2 41 29 PM

Frontend

Desktop Tablet Mobile
localhost_8888_latest-news-cards_(Desktop) (1) localhost_8888_latest-news-cards_(iPad) localhost_8888_latest-news-cards_(Samsung Galaxy S20 Ultra)

Developer

localhost_8888_(Desktop) (9)

Testing

  1. Ensure you have posts and categories saved
  2. Add a latest news block, set style to 'Cards' and enable 'Show Categories'
  3. Block should display like design in editor and frontend
  4. Regression test the default styles
  5. Ensure most used categories are displayed in the popular categories list

@adamwoodnz adamwoodnz self-assigned this Oct 25, 2023
@adamwoodnz adamwoodnz added this to the MVP milestone Oct 25, 2023
@adamwoodnz adamwoodnz added the Redesign Related to the wordpress.org redesign project label Oct 25, 2023
@adamwoodnz adamwoodnz force-pushed the enhance/448-latest-news-cards-style branch 2 times, most recently from 3d058e4 to 648f338 Compare October 25, 2023 01:29
@adamwoodnz adamwoodnz requested review from StevenDufresne, renintw and a team October 25, 2023 01:49
@jasmussen
Copy link
Collaborator

Looks good!

  • Just to confirm, the text inside the boxes is 16px and the text below, "Popular categories" is 14 correct? (That's what they should be)
  • Desktop looks good, and the way items wrap, especially the title, is correct, i.e. top-aligned vs. center aligned. The way the date stacks on mobile is also fine. But in your block editor screenshot, and in the tablet screenshot, the date (September 14, 2023) wraps on two lines, which is not ideal. There's probably a site-wide separate issue we can look into, in terms of changing the date format. I.e. maybe Sep. 14, 2023 might help a lot, but unless we can do that in this PR it would be good to think about other solutions.
  • Can we add white-space: nowrap; to the date, so that it never wraps and instead expands the column?
  • Or can we increase the breakpoint so it stacks sooner?
  • Ideally we can make a consistent rule for displaying date/time-stamps to document for every section across the site. But in lieu of that, perhaps we can make an exception to do it just for this one site, then establish the rule here, and apply it elsewhere as we go?

Let me know your thoughts.

@adamwoodnz
Copy link
Contributor Author

  • the text inside the boxes is 16px and the text below, "Popular categories" is 14 correct?

Correct!

  • But in your block editor screenshot, and in the tablet screenshot, the date (September 14, 2023) wraps on two lines, which is not ideal

I'll experiment with no-wrap and column size, I think the full text is probably fine unless we like the shorter format.

  • perhaps we can make an exception to do it just for this one site, then establish the rule here, and apply it elsewhere as we go?

👍 Works for me

@adamwoodnz adamwoodnz force-pushed the enhance/448-latest-news-cards-style branch from 3629c42 to 40a27cf Compare October 25, 2023 23:16
@adamwoodnz
Copy link
Contributor Author

adamwoodnz commented Oct 25, 2023

Updated to use white-space: nowrap and also increased the breakpoint where we switch to a 2 row layout (599px -> 767px), works well I think:

Screenshots

Tablet (768px) < Tablet (767px shown)
localhost_8888_latest-news-cards_(iPad) localhost_8888_latest-news-cards_

@adamwoodnz adamwoodnz force-pushed the enhance/448-latest-news-cards-style branch from 40a27cf to 178d802 Compare October 26, 2023 02:22
@adamwoodnz
Copy link
Contributor Author

Merging this, but we can further refine the responsive behaviour if necessary.

@adamwoodnz adamwoodnz merged commit ac415e2 into trunk Oct 26, 2023
@adamwoodnz adamwoodnz deleted the enhance/448-latest-news-cards-style branch October 26, 2023 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Latest News Redesign Related to the wordpress.org redesign project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update Latest News block to support cards style and popular categories list
2 participants