Skip to content

Conversation

@laurelfulford
Copy link
Contributor

@laurelfulford laurelfulford commented Jul 12, 2022

All Submissions:

Changes proposed in this Pull Request:

This PR contains a first swing at the featured listing styles for the Newspack theme.

I think it made sense to tackle them in the theme rather than the plugin because the styles might differ from theme to theme, and that the styles are applied to blocks in two different plugins (Newspack Blocks, Newspack Listings), on top of the archive and search styles in the theme. Happy to discuss that further if moving them makes sense though!

See Automattic/newspack-listings#131.

How to test the changes in this Pull Request:

  1. Enable Featured Listings on your test site by adding define( 'NEWSPACK_LISTINGS_FEATURED_ENABLED', true ); to your wp-config.php file.
  2. Create a number of listings and mark some as 'Featured'.
  3. Add the Homepage Posts block, Post Carousel Block and Curated List Listings block; make sure at least one Featured listing appears in all three.
  4. Navigate to Customizer > Colors and change your primary colour.
  5. View your post on the front-end and in the editor; confirm that your featured listings have a little "ribbon" icon that uses the site's primary colour:

Homepage Posts block:

image

Post Carousel:

image

Curated List (note: the featured image classes are not yet added to the curated list block in the editor; issue filed here).

image

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@laurelfulford laurelfulford marked this pull request as ready for review July 19, 2022 02:06
@laurelfulford laurelfulford requested a review from a team as a code owner July 19, 2022 02:06
@laurelfulford laurelfulford added the [Status] Needs Review The issue or pull request needs to be reviewed label Jul 19, 2022
@laurelfulford laurelfulford changed the title feat: rough in featured listing styles feat: Add featured listing styles Jul 19, 2022
Copy link
Contributor

@dkoo dkoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is 99% there, but I noticed a tiny gap in the "ribbon" icon when I place a Homepage Posts in the sidebar widget and enable listing post types:

Screen Shot 2022-08-01 at 4 47 08 PM

@laurelfulford
Copy link
Contributor Author

Oh, good catch @dkoo! I used em to keep the ribbon proportionate to the text, but it looks like that resulted in a bit of a pixel rounding issue at some font sizes (I was able to recreate this in the editor, too, by scaling up the font size of the block!).

I've added a pixel of wiggle room that seems to help! I also switched how the bottom "cut in" was measured -- it was originally a pixel value but got a little disproportionate at smaller font sizes. It now uses em, too 🙂

Just let me know if anything else seems funky to you!

@laurelfulford laurelfulford requested a review from dkoo August 4, 2022 18:54
Copy link
Contributor

@dkoo dkoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good now!

Screen Shot 2022-08-05 at 4 13 08 PM

@dkoo dkoo merged commit efc4936 into master Aug 5, 2022
@dkoo dkoo deleted the feat/featured-listing-styles branch August 5, 2022 22:13
@github-actions github-actions bot added [Status] Approved The pull request has been reviewed and is ready to merge and removed [Status] Needs Review The issue or pull request needs to be reviewed labels Aug 5, 2022
matticbot pushed a commit that referenced this pull request Aug 5, 2022
# [1.63.0-alpha.1](v1.62.0...v1.63.0-alpha.1) (2022-08-05)

### Bug Fixes

* **registration-block:** make sure font-family in the editor matches front-end ([#1889](#1889)) ([e0c4309](e0c4309))

### Features

* add custom style for upcoming registration pattern (style 1) ([#1888](#1888)) ([58f303d](58f303d))
* Add featured listing styles ([#1877](#1877)) ([efc4936](efc4936))
* colors' css variables and action hook for mobile toggle ([#1875](#1875)) ([0830ca7](0830ca7))
* redesign "My Account" page ([#1879](#1879)) ([9258f21](9258f21))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 1.63.0-alpha.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

matticbot pushed a commit that referenced this pull request Aug 16, 2022
# [1.63.0](v1.62.0...v1.63.0) (2022-08-16)

### Bug Fixes

* **registration-block:** make sure font-family in the editor matches front-end ([#1889](#1889)) ([e0c4309](e0c4309))
* use proper variable and escape function for primary color ([#1898](#1898)) ([1062b1a](1062b1a))

### Features

* add custom style for upcoming registration pattern (style 1) ([#1888](#1888)) ([58f303d](58f303d))
* Add featured listing styles ([#1877](#1877)) ([efc4936](efc4936))
* colors' css variables and action hook for mobile toggle ([#1875](#1875)) ([0830ca7](0830ca7))
* redesign "My Account" page ([#1879](#1879)) ([9258f21](9258f21))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 1.63.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released on @alpha released [Status] Approved The pull request has been reviewed and is ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants