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

[CYS on Core] Ensure the size of fonts is not affected by the font family changes #44424

Merged
merged 4 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,7 @@ export const VariationContainer = ( { variation, children } ) => {
user.settings,
variation.settings
),
styles: mergeBaseAndUserConfigs(
user.styles,
variation.styles
),
styles: variation.styles,
Copy link
Member

Choose a reason for hiding this comment

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

Hey @albarin Thanks for working on this! 👍

Unlike the GB site editor, I use mergeBaseAndUserConfigs here because we've split style variations into font and color parts. We need to preserve the color changes when updating the font and vice versa.

I tested this PR on JN, and you can see when I change the color and then update the font, the color gets reset. I think this is a bit tricky. Perhaps a way to fix it is to create a custom merge function. 🤔

Screen.Recording.2024-02-08.at.11.27.15.mov

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @chihsuan, great feedback!
I've addressed it 15a1b4e let me know what you think.
What I'm doing it remove all the typhography settings from the styles before applying new ones.

};
} );
};
Expand Down
4 changes: 4 additions & 0 deletions plugins/woocommerce/changelog/44424-44259-fix-font-size
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: fix

CYS - Ensure the size of fonts is not affected by a font family change.