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 posts block: Smaller font size for content and preserve content formatting #15722

Closed
arunsathiya opened this issue May 19, 2019 · 5 comments
Labels
[Block] Latest Posts Affects the Latest Posts Block Needs Design Feedback Needs general design feedback. [Type] Enhancement A suggestion for improvement.

Comments

@arunsathiya
Copy link
Contributor

arunsathiya commented May 19, 2019

Is your feature request related to a problem? Please describe.

The Latest posts block has a new feature (#14627 and #15453) to show post content. This is a great feature addition!

Although, when the content setting is enabled, the font size of the content matches the title font size.

The formatting of the content is not preserved either.

Describe the solution you'd like

  • Set the content to a smaller font size by default. (requiring no custom CSS from user's end)
  • Preserve content formatting (that is, new lines, bold, italics, and other customizations that can be seen on the actual blog post) on the Latest posts block as well.

Example:

Screenshot 2019-05-19 at 14 31 08

Screenshot 2019-05-19 at 14 31 12

In these two images, it can be seen that:

  • Font size of the content is the same as font size of the title.
  • The new lines from the actual post content (after the sentence Tubulo putas dicere? in Post 19) is not seen on the Latest posts block.

Describe alternatives you've considered

  • For now, can change content font size using CSS.

Gutenberg, browser and device version:

I am using Gutenberg 5.7.0-rc-1 on a Pressable site, with Google Chrome Version 74.0.3729.131 (Official Build) (64-bit) on macOS 10.14.4 - Mac OS Mojave.

@youknowriad
Copy link
Contributor

I think it makes sense to me. cc @kjellr @AmartyaU

@youknowriad youknowriad added [Block] Latest Posts Affects the Latest Posts Block [Type] Enhancement A suggestion for improvement. Needs Design Feedback Needs general design feedback. labels May 21, 2019
@kjellr
Copy link
Contributor

kjellr commented May 21, 2019

Font size of the content is the same as font size of the title.

This is just a Twenty Nineteen problem actually. Currently, Twenty Nineteen styles target everything within the latest post li item. It should really just style the title and post date. The excerpt should be unstyled and fall back to the default post content text styles. I'll work on that this week and link it back here. Other themes may need patches too, depending on how they've built these styles. UPDATE: Twenty Nineteen issue and patch are here: https://core.trac.wordpress.org/ticket/47340

By default (if a theme supplies no styles), Latest Posts will look something like this:

Screen Shot 2019-05-21 at 10 27 54 AM

If anything, I think we could provide a little bottom padding to each of the latest posts. @jasmussen, what do you think? I know there's been pushback about adding styles like that.

The new lines from the actual post content (after the sentence Tubulo putas dicere? in Post 19) is not seen on the Latest posts block.

Showing new lines is possible if you use the toggle and show the full post instead:

Screen Shot 2019-05-21 at 1 25 49 PM

Excerpts by default in WordPress remove all formatting, so I'm not sure we should change that here.

@jasmussen
Copy link
Contributor

If anything, I think we could provide a little bottom padding to each of the latest posts. @jasmussen, what do you think? I know there's been pushback about adding styles like that.

Honestly I think it's fine to do this to provide a good baseline. We even have some options here — if we feel the styles are fundamental, they go in style.scss which is loaded in editor and frontend regardless. We just need to make sure that the CSS we write has as little specificity as possible.

If we're on the fence about the fundamental necessity of those margins, we put them in editor.scss, which means themes that opt in get it. The only downside to putting it here is that it's still loaded in the editor even if not on the frontend.

@kjellr
Copy link
Contributor

kjellr commented May 21, 2019

Thanks, @jasmussen. I've opened #15760 to try this out.

@kjellr
Copy link
Contributor

kjellr commented May 27, 2019

I'm going to mark this one as closed for now:

#15760 adds some default spacing.
47340-trac handles this fix in Twenty Nineteen.

Thanks!

@kjellr kjellr closed this as completed May 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Latest Posts Affects the Latest Posts Block Needs Design Feedback Needs general design feedback. [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

4 participants