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

Fix: Remove color styles from typography variation controls - #61217 #61280

Closed
wants to merge 1 commit into from

Conversation

hbhalodia
Copy link
Contributor

What?

Why?

  • This would remove the global style colors being added to the typography variation in the style's editor page.

How?

  • This PR adds the extra props addGlobalStyles, if this is passed as false, it would not add the style to the iframe preview.
  • This is necessary because, the same component reused at multiple instance, hence in order to not make effect to other place, such as the style variations we need to pass it as a prop and do action based on the prop provided.

Testing Instructions

  1. Checkout to this branch.
  2. Run the NPM run build process.
  3. Open the site → editor → styles → typography.
  4. You would see that, the typography options have now natural black and white color combination, and it would be the same for each of the style variations.

Testing Instructions for Keyboard

  • NIL

Screenshots or screencast

GB.Issue-.61217.webm
This would fix the issue added in WordPress#61217, This wanted to remove the color combination in the typography preview shown in the styles editor page
Copy link

github-actions bot commented May 1, 2024

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: hbhalodia <hbhalodia@git.wordpress.org>
Co-authored-by: scruffian <scruffian@git.wordpress.org>

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

@@ -94,6 +94,7 @@ function SidebarNavigationScreenGlobalStylesContent() {
) }
{ typographyVariations?.length && (
<TypographyVariations
addGlobalStyles
Copy link
Contributor Author

@hbhalodia hbhalodia May 1, 2024

Choose a reason for hiding this comment

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

Hello @richtabor,

I am passing this prop as true here, because I am thinking we should keep the color combination in the sidebar navigation global screen, Let me know if we need to remove the color from here as well, I will update the PR.

Thank You.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should remove it here.

Copy link
Contributor Author

@hbhalodia hbhalodia May 23, 2024

Choose a reason for hiding this comment

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

Sure, I will work on this PR and update it by removing the color from here as well.

So after update, both the global screen and side panel would not have the color effect in the typography. Am I correct?

Hence, I am guessing that, we should remove the props from all places, if we make it consistent.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I had a different idea for how to do it which I tried here: #61898

I'm not sure which option is better, what do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, looks like the good option. Just add the styles to iframe whatever we want using this prop.

@scruffian
Copy link
Contributor

I'm not sure about the approach here. Adding a new addGlobalStyles feels quite heavy handed. An alternative could be to pass a styles object from typography variations to the style preview, like this: #61898

@scruffian
Copy link
Contributor

This was closed by #62578

@scruffian scruffian closed this Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants