gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

Consider adding color and text size customizations to all text-based blocks.

Open kjellr opened this issue 8 years ago • 51 comments

Currently, it's possible to change the background color and text color for paragraph blocks:

screen shot 2018-07-24 at 10 30 46 am

Those options are not available for other text-based blocks though: headings, lists, quotes, preformatted, subheadings, verse.

Conceptually, it's not immediately clear why those settings are not available to all text blocks.

Suggestion

For consistency, I think we should consider adding these options to other text-based blocks on a case by case basis. Here are some initial thoughts:

Headings It probably doesn't make sense to include text size controls here, as it would upset the type size hierarchy of all the headings. But I think color options could make sense.

Lists From a visual perspective, lists are essentially just a series of paragraphs with bullets/numbers — it seems like users should be able to make text size + color customizations to list blocks.

Quotes Quotes have their own Block Styles, so I'd understand that these settings could get really complicated and messy. Color options might make sense though.

Preformatted I think both size and color options could work here. It's worth noting that the description of this block says "Add text that respects your spacing and tabs, and also allows styling." (emphasis mine), but there are currently no styling options.

Subheadings If we add text options here, I think this block might lose it's reason for existing. (It renders as just a normal paragraph with specific styles anyway). But I do think that users would expect to be able to edit the styles here.

Verse This is visually identical to the paragraph block, so I think it should have the same size and color options.


Also, assuming we adopted any of these suggestions, those settings should carry over when using Block Transforms — if you were to transform a paragraph block to a list block, you should carry over its font size and color settings.

kjellr avatar Jul 24 '18 14:07 kjellr

Quotes should become a block that uses nested Paragraph, List, and Heading blocks in the future. See #6520. So that pretty much covers having colored text in those, except for perhaps general background color.

I think the Heading and List blocks should definitely have text and background color options. I do not feel as strongly about the Preformatted and Verse blocks, but I think those should have text and background color options as well. I mainly feel this way because, while page building, you are likely to end up using various background colors provided by sections, and you will want to make your text readable on those backgrounds. The Heading, List, and Paragraph blocks would be the most-used in page building out of all the standard text blocks, and I think they definitely should have text color options.

I think the Subheading block does not need any styling options as subheadings would probably be expected to look the same across a website, not being used much (if at all) in page building contexts (it is mainly intended for things like blog posts and news articles), with any variations being supplied by themes. I would not be opposed to it having color options as well, though.

ZebulanStanphill avatar Jul 24 '18 16:07 ZebulanStanphill

Agreed that the headings probably shouldn't include text size settings, as this could be detrimental to the visual hierarchy set by themes. However, headings and lists should at least have color options, as the paragraph block does. It should be consistent, so either the text-based blocks get colors or none of them get colors.

mikemcalister avatar Jul 24 '18 17:07 mikemcalister

Got another request for this in #10377 which also sort of brought up something interesting… some themes will give different elements different sizes by default, e.g. twentythirteen styles <blockquote> in a slightly larger font size.

Would themes need to be able to set different font size options per-block? Or perhaps a default font size per block? I could see this getting messy pretty quickly.

chrisvanpatten avatar Oct 06 '18 12:10 chrisvanpatten

To add onto this thread I have a few suggestions after building a couple of sites with the Gutenberg plugin. I noticed that there are a few blocks that could really use theme support for colors. Here's what I think makes the most sense (open to other ideas of course):

  • Heading block: Text color
  • Column block: Background color for wrapper, Background color for individual columns (less important)
  • List block: Text color
  • Cover block: Text color
  • Separator block: Background color

Let me know what you think!

riemerta6 avatar Oct 26 '18 16:10 riemerta6

I agree with all of this and would also like to suggest that all blocks have alignwide and align full as well. I see no reason to let paragraphs and images do this, but not headings and other content. Plus it makes it more consistent from a user perspective. The more options that apply to all blocks, the better.

As an example, if you center a heading above a wide block, the heading isn’t actually centered because the heading width is narrow. So it looks terrible.

screen shot 2018-11-28 at 10 42 25 am

Simply adding "alignwide" to the heading would then center it perfectly as desired.

screen shot 2018-11-28 at 10 45 29 am

timnicholson avatar Nov 28 '18 16:11 timnicholson

Adding here that I think the heading (and other text blocks mentioned above) should have the color option the same way paragraph blocks do.

aisajib avatar Dec 10 '18 14:12 aisajib

To add onto this thread I have a few suggestions after building a couple of sites with the Gutenberg plugin. I noticed that there are a few blocks that could really use theme support for colors. Here's what I think makes the most sense (open to other ideas of course):

  • Heading block: Text color
  • Column block: Background color for wrapper, Background color for individual columns (less important)
  • List block: Text color
  • Cover block: Text color
  • Separator block: Background color

Let me know what you think!

Very much agree - particularly with the Column block. Though I would say that individual column colours would be equally important !

presidentnickson avatar Jan 08 '19 12:01 presidentnickson

@kjellr I believe your suggestions make really good sense here.

Headings - Add color options.

Lists - Add text-size and color options.

Quotes - Add color options. Does the color option also effect the left-border? Or is it only text and background options?

Preformatted - Add text-size and color options.

Subheadings - I'm unclear on the background here. Is a "subheading" block necessary? Either way, I think adding text-size and color options makes sense. As long as the user is able to switch back to the default theme settings anytime. <-- this should be true for any of the blocks i think.

Verse - Add text-size and color options.

I wonder if another ticket should be created around the possibility to adjust the size and colors and save it as a style variation for a particular block. I know, there's probably a ticket somewhere for this.

I'd also like to move this ticket forward, so I'm opting that we don't add to the initial requested features and blocks. Other blocks and features (ie. alignment settings, and/or column backgrounds, etc) should be created in another ticket. Excellent ideas BTW!

mapk avatar Jan 21 '19 20:01 mapk

Quotes - Add color options. Does the color option also effect the left-border? Or is it only text and background options?

Yes, I think having the color option effect the left border could be cool. Might take some testing to get it right.

Subheadings - I'm unclear on the background here. Is a "subheading" block necessary? Either way, I think adding text-size and color options makes sense. As long as the user is able to switch back to the default theme settings anytime. <-- this should be true for any of the blocks i think.

Yeah, this block has been depreciated, so I think that can be left out.

kjellr avatar Jan 21 '19 21:01 kjellr

I can see a case for this, but I'm also worried. I have seen many cases in the past of users trying to control the look and feel of their site using styles in TinyMCE, which we all know is a terrible idea. I'd worry that this would encourage users to do the same things with blocks.

scruffian avatar Jan 30 '19 15:01 scruffian

I can see a case for this, but I'm also worried. I have seen many cases in the past of users trying to control the look and feel of their site using styles in TinyMCE, which we all know is a terrible idea. I'd worry that this would encourage users to do the same things with blocks.

I definitely understand this concern. 🙂

However, from my perspective, there are two main arguments to adding this in:

First, a small(ish) reason: whatever we do, we should be consistent. It seems really weird that users can choose colors for a paragraph right now, but as soon as they add bullets to that paragraph, the colors disappear:

list

That's arguably a bug, and should be fixed.

But beyond stuff like that, we're in a bit of a different era compared to when we advised users against changing styles in TinyMCE. Not only can themes now provide custom color palettes to help guide users towards more consistent color usage, but we can also leverage awesome tools like our a11y contrast warning to help them make more accessible color choices. Themes can also provide standard font sizes for users to select. Gutenberg is handing a bit more control over to the user, but — unlike before — our tools today can help guide users to make better choices.

In general, Gutenberg is all about customization. Today, it's about customizing what you see inside your posts. But eventually, that'll expand to the entire site. Someday, users will change the entire look and feel of their site within the context of blocks. Standardizing these sorts of things sets us all up for success along that path.

kjellr avatar Jan 30 '19 19:01 kjellr

There's an interesting thread going on for the Calypso project, with this comment bringing an interesting challenge to the table:

I manually set every paragraph using HTML, and my text did not justify. I work in a university setting, and my boss requires all of our pages to have justified text. Hope this gets added soon.

From reading this, it doesn't feel like bringing back the “justify text” option on a per-block basis is going to be anything more than a bandaid solution.

Perhaps we could consider "justify text" as being a global style change, like text color is? If so, how would that look like in this interface?

jasmussen avatar Feb 06 '19 11:02 jasmussen

I definitely agree that standardizing is the way forward, but my preference would be to remove this kind of fine grained control from the user. We could offer similar levels of control via block styles and themes, but in a way that enables users to create beautiful sites, rather than just letting them create anything.

scruffian avatar Feb 06 '19 11:02 scruffian

Perhaps we could consider "justify text" as being a global style change, like text color is? If so, how would that look like in this interface?

In the classic editor it was easy to select a bit (or all) of text and apply justification. If this is a per block action in Gutenberg, it definitely will get cumbersome. It would be great to explore a way to select multiple text pieces within Gutenberg and apply a style (justification) to all of them at once.

We could offer similar levels of control via block styles and themes, but in a way that enables users to create beautiful sites, rather than just letting them create anything.

Seeing that this issue specifically targets block color and font-size, I'm hoping we can at least improve the consistency between similar blocks.

mapk avatar Feb 06 '19 16:02 mapk

In the classic editor it was easy to select a bit (or all) of text and apply justification. If this is a per block action in Gutenberg, it definitely will get cumbersome.

Definitely agree that this is the core problem to solve.

It would be great to explore a way to select multiple text pieces within Gutenberg and apply a style (justification) to all of them at once.

This is where I'm not sure I agree.

To me, the choice between normal text and justified text is similar to the choice between Arial or Times New Roman, in that it only really makes sense to do as a global change, especially in an editor destined to write for the web. I acknowledge that you might want to just one paragraph to Arial and keep the rest Times, but that seems more like an edgecase, and especially in case of justified text it seems like something that only makes sense for all blocks and all posts.

Consider also this comment which was highlighted in the thread I referenced:

We run a local newspaper website, and have always used full justification. I've been getting worried about not being able to get it sorted, and the idea of going into every news story to add css is a nightmare. However, the simple solution, if you are going to use full justification on all posts is to add the following css to your theme: .post { text-align: justify; } Obvious to most, I'm sure, but it's an option not mentioned anywhere that I've looked. I suppose you could just add that to the advanced section on single posts, but not something I've tested.

All of the above, to me, suggests that the solution isn't to add back the justify button, but to make it easy for anyone to change the justification globally. That is — you should not have to select anything and apply a justification — it's likely better to have you change this in a more global setting context.

jasmussen avatar Feb 07 '19 08:02 jasmussen

To me, it makes no sense to have per-block options for left, center, or right alignment, but only a global toggle for justified alignment. It feels inconsistent.

In fact, technically, Gutenberg already supports a global default for alignment... just like it supports a global default for any CSS property, given that themes can provide that. A theme can set the default text alignment to justify, and if you don't set a custom alignment on any blocks, then they should all use that alignment.

That's why the toolbar has a left align button... so you can override the default alignment, which may not be left alignment (though it is in most themes).

ZebulanStanphill avatar Feb 07 '19 15:02 ZebulanStanphill

All of the above, to me, suggests that the solution isn't to add back the justify button, but to make it easy for anyone to change the justification globally.

I could be completely missing it, so I apologize, but I want to reaffirm that this issue does not include text justification controls. It only pertains to the color and text-size options. While I agree with the points made for justification, I believe in order to keep moving this forward, maybe we can separate those out into another issue?

mapk avatar Feb 11 '19 22:02 mapk

I could be completely missing it, so I apologize, but I want to reaffirm that this issue does not include text justification controls. It only pertains to the color and text-size options. While I agree with the points made for justification, I believe in order to keep moving this forward, maybe we can separate those out into another issue?

Not at all, sorry for taking this slightly off track. I added my comment about justified text mostly to get impressions on whether this should be a global option or a block-local one. Definitely needs a separate ticket.

jasmussen avatar Feb 12 '19 10:02 jasmussen

Im going to make the case for adding heading text size controls. I know it seems odd but please see this issue which provides a rationale

https://github.com/WordPress/gutenberg/issues/14183

Can we try and come to a consensus and get this built?

getdave avatar Mar 07 '19 08:03 getdave

Can we try and come to a consensus and get this built?

I believe there's general agreement on the fact that this is needed — Just looking for a dev with time to implement at this point.

kjellr avatar Mar 07 '19 13:03 kjellr