Skip to content

DateCalendar, DateRangeCalendar: use px instead of rem, use theme-ready variables #105264

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

Merged
merged 2 commits into from
Aug 20, 2025

Conversation

ciampo
Copy link
Contributor

@ciampo ciampo commented Aug 19, 2025

What?

Note: This PR applies the same changes as in WordPress/gutenberg#71248

Switch from rem to px units for some internal sizes (day button size, nav height, months gap).

Why?

Until now, the DateCalendar and DateRangeCalendar components would render in unexpected ways depending on the HTML base font size.

The changes in this PR enforce the same metrics across environments with different base HTML font sizes.

How?

Switch from rem to px, assuming a 16px base font size.

Testing Instructions

Compare Storybook examples on trunk and this PR:

  • there shouldn't be any visual differences when the base HTML font size is set to 16px
  • when (manually) changing the HTML base font size, the metrics of the version on trunk are expected to change, while the version from this PR should stay unchanged

@ciampo ciampo self-assigned this Aug 19, 2025
Copy link

github-actions bot commented Aug 19, 2025

@ciampo ciampo requested review from jameskoster and a team August 19, 2025 11:09
@matticbot matticbot added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Aug 19, 2025
@ciampo ciampo added [Type] Bug When a feature is broken and / or not performing as intended and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Aug 19, 2025
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Aug 19, 2025
@ciampo ciampo added Components and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Aug 19, 2025
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Aug 19, 2025
@matticbot
Copy link
Contributor

matticbot commented Aug 19, 2025

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • notifications

To test WordPress.com changes, run install-plugin.sh $pluginSlug fix/calendar-rem-px on your sandbox.

@ciampo ciampo changed the title DateCalendar, DateRangeCalendar: use px instead of rem DateCalendar, DateRangeCalendar: use px instead of rem, use theme-ready variables Aug 19, 2025
@ciampo ciampo merged commit d389b45 into trunk Aug 20, 2025
11 checks passed
@ciampo ciampo deleted the fix/calendar-rem-px branch August 20, 2025 07:56
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Aug 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Components [Type] Bug When a feature is broken and / or not performing as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants