Skip to content

Conversation

@ghorivipul97
Copy link
Contributor

#50448

What?

Added Default Color of Model heading & Labels

Why?

Default theme color and editor text color are different so need to apply common colour for all model

How?

Apply default color class to model edior

Testing Instructions

  • Open any Model
  • Check default color of label and heading

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Jun 5, 2023
@github-actions
Copy link

github-actions bot commented Jun 5, 2023

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @ghorivipul97! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@mikachan mikachan requested a review from richtabor June 8, 2023 13:02
@mikachan mikachan linked an issue Jun 8, 2023 that may be closed by this pull request
@mikachan
Copy link
Member

mikachan commented Jun 8, 2023

👋 @ghorivipul97, thank you for working on this! It looks like you may need to run npm run test:unit -- -u to update the test snapshots, and then commit any updates to this PR. This will hopefully allow the tests to pass.

@ghorivipul97 ghorivipul97 requested a review from gziolo as a code owner June 8, 2023 16:54
@richtabor richtabor requested review from mikachan and removed request for richtabor June 14, 2023 20:29
Copy link
Member

@mikachan mikachan left a comment

Choose a reason for hiding this comment

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

It looks like the heading color has not been applied, but I can see the additional class has been added to the modal container:

Trunk This PR
Screenshot 2023-06-23 at 14 12 52 Screenshot 2023-06-23 at 14 15 40

It seems that the desired color #1e1e1e is being overridden by #1d2327. We perhaps need to add this style somewhere more specifically, maybe somewhere like this: https://github.com/WordPress/gutenberg/blob/trunk/packages/components/src/modal/style.scss#L92

@ghorivipul97
Copy link
Contributor Author

It looks like the heading color has not been applied, but I can see the additional class has been added to the modal container:

Trunk This PR
Screenshot 2023-06-23 at 14 12 52 Screenshot 2023-06-23 at 14 15 40
It seems that the desired color #1e1e1e is being overridden by #1d2327. We perhaps need to add this style somewhere more specifically, maybe somewhere like this: https://github.com/WordPress/gutenberg/blob/trunk/packages/components/src/modal/style.scss#L92

okay

@ghorivipul97 ghorivipul97 requested a review from ajitbohra as a code owner July 3, 2023 16:54
Copy link
Contributor

@stokesman stokesman left a comment

Choose a reason for hiding this comment

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

Thanks for working on this!

I think we might want to petition for some design scrutiny here because it does affect more than just text colors. The margin and size of subheadings are also affected. A comparison:

pref-modal-51246-compare
(The smaller and more spaced out headings is this PR).

Because the class/styles from the Interface package are making the difference I'd want to think it’s good and helps with consistency. Although, I'd not say that spacing is an improvement.

I think we might consider moving this forward by only affecting color and leaving the rest for another issue.

h1 {
line-height: 1;
margin: 0;
color: $gray-900;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
color: $gray-900;
color: $components-color-foreground;

In the components package this is the appropriate variable to apply for color (so that it can be themed).

return (
<Modal
className="interface-preferences-modal"
className="interface-preferences-modal interface-complementary-area"
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the change that also brings in font-size and margin differences to the subheadings. Another thing to note is this won't correct the color issues noted in other modals like the one for Block locking mentioned in the issue. Those modals aren't based on this component. I'd be interested in evaluating some other options.

One option might be to simply add a rule for color here:

.interface-preferences-modal__section-title {
font-size: 0.9rem;
font-weight: 600;
margin-top: 0;
}

Another option if we do want all the font-size and margin differences is to convert the styles of interface-complementary-area into a mixin that can also be used on interface-preferences-modal because I think that'd be cleaner than doubling up on class names from the interface package on this element.

Finally if it's not considered too prescriptive there's a rule we could add to the base Modal component that would obviate the need to change anything in the Interface package and also cover the other modals. That's something like this:

.components-modal__frame * {
	color: $components-color-foreground;
}

I'm not sure that would get sign-off from the component crew but it'd be the most succinct way to fix this.

@Mamaduka Mamaduka added the [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. label Aug 21, 2025
@Mamaduka
Copy link
Member

Hi, @ghorivipul97

Would you still like to work on this PR and address the feedback? Otherwise, we can close this as "stale".

@github-actions
Copy link

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: ghorivipul97 <[email protected]>
Co-authored-by: mikachan <[email protected]>
Co-authored-by: stokesman <[email protected]>
Co-authored-by: Mamaduka <[email protected]>
Co-authored-by: t-hamano <[email protected]>
Co-authored-by: falgunihdesai <[email protected]>
Co-authored-by: richtabor <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@t-hamano t-hamano added [Type] Bug An existing feature does not function as intended [Package] Components /packages/components labels Aug 23, 2025
@juanfra
Copy link
Member

juanfra commented Sep 4, 2025

Thank you for working on this. Closing as fixed in #71311

@juanfra juanfra closed this Sep 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Package] Components /packages/components [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Modal headings and labels missing editor text color

6 participants