Automattic / newspack-blocks

Gutenberg blocks for the Newspack project.
207 stars 43 forks source link

Post Carousel Block: Unset .author position #1104

Open supernovia opened 2 years ago

supernovia commented 2 years ago

Describe the bug A theme's style is moving the author outside the swiper box to some other place on a page.

This may only occur on one theme, but where there's one weird practice like that in an older theme, I'm sure someone else would have thought it was a good idea at the time. Would we consider unsetting this position?

To Reproduce

  1. Use an affected older theme (in this case, Rebalance)
  2. Add the posts carousel block
  3. Make sure all of the post meta is enabled in the block preferences
  4. Notice whether it appears as expected in the swiper block

Screenshots The offending code in Rebalance, which is coded into the page itself:

Screen Shot 2022-04-16 at 4 00 16 PM

Here's a screenshot of the author element dropping outside the slider to who knows where:

Screen Shot 2022-04-16 at 3 59 58 PM

Expected behavior

Adding this would fix it the author positioning if the site supports CSS. But HEs aren't even supposed to give out CSS fixes anymore, even in cases of bugs or conflicts. We're supposed to instead encourage the user to switch themes or use a different block, and report an issue with the block.

In this case, I'm encouraging the user to un-toggle the option that displays the author in the carousel. But this CSS also fixes it. And I've noticed most other elements of entry meta have some style to them. If we wouldn't mind adding this, that could help people :)

.wp-block-newspack-blocks-carousel article .entry-meta .author {
    position: unset;
}

BTW, though I can't name them off the top of my head, I'm sure some other themes also have weirdly positioned bits of entry meta. We might consider unsetting positions for all, but we'd probably have to name each one since wp-block-newspack-blocks-carousel article .entry-meta > * didn't fly.

The issue is reported here: https://wordpress.com/forums/topic/previous-post-carousel/

mriyazuddin commented 2 years ago

Similar issue reported here: 4961441-zen