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

default CSS class 'has-text-color' is not replaced #13359

Closed
robincornett opened this Issue Jan 17, 2019 · 1 comment

Comments

Projects
None yet
3 participants
@robincornett
Copy link

robincornett commented Jan 17, 2019

Describe the bug
It looks like blocks such as the core paragraph block start with a CSS class of has-text-color. When the text color is changed to something else in the presupplied color palettes, instead of this class being replaced, a new class is added, so a paragraph might end up with a duplicate has-*-color class, and whichever is later in the stylesheet wins.

To Reproduce
Steps to reproduce the behavior:

  1. Activate Twenty Nineteen and create a new post
  2. Create a simple paragraph
  3. Change the background color (optional)
  4. Change the text color to an editor color palette supplied color

Expected behavior
I expect just one has-*-color class to be applied to the block.

Actual behavior
This is the HTML output in the HTML editor. Removing has-text-color by hand breaks the block and results in this warning: "This block contains unexpected or invalid content."

<p class="has-text-color has-primary-color">This is a new paragraph.</p>

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser Firefox
  • Version 64.0.2 (64 bit)

Additional context

  • Using WordPress 5.0.3
  • This happens with and without Gutenberg (4.8.0) active
@youknowriad

This comment has been minimized.

Copy link
Contributor

youknowriad commented Jan 18, 2019

Thanks for opening the issue.

I think this is expected behavior. The first class here indicates that there's a color applied, the second classes indicates which class is applied.

I'm closing this but let me know why you think this is problematic?

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