-
Notifications
You must be signed in to change notification settings - Fork 4.5k
DateCalendar, DateRangeCalendar: use px instead of rem units, better theming support #71248
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
Conversation
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: +36 B (0%) Total Size: 1.92 MB
ℹ️ View Unchanged
|
Flaky tests detected in 87cfbcc. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/17067176510
|
Should we use Seems good otherwise :) |
@jameskoster good point — I updated dimensions (and colors) to use variables when possible. This also has the added benefit of better supporting color theming: ![]() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
@@ -9,6 +9,7 @@ | |||
### Internal | |||
|
|||
- Validated form controls: Add support for async validation. This is a breaking API change that splits the `customValidator` prop into an `onValidate` callback and a `customValidity` object. ([#71184](https://github.com/WordPress/gutenberg/pull/71184)). | |||
- `DateCalendar`, `DateRangeCalendar`: use `px` instead of `rem` units. ([#71248](https://github.com/WordPress/gutenberg/pull/71248)). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to highlight this as a bug fix which improves visual appearance / compatibility in applications which use a base font size other than 16px?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it usually would, but we're marking it as internal in the CHANGELOG since the components receiving the fix are not public APIs (yet).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it usually would, but we're marking it as internal in the CHANGELOG since the components receiving the fix are not public APIs (yet).
Ah, fair 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see we've been using this "private API changes are internal" policy for quite some time, but I would reconsider it. Private API is still an API, used quite widely across Gutenberg and semi-legally in plenty of plugins. I understand "internal" changes as some implementation detail patch that's invisible to the user. But bugfixes and enhancements to private API are quite on par with similar changes in public APIs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to change the policy — your suggestion would work for me too, as far as we apply it consistently!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would be fine with that too 👍
…theming support (WordPress#71248) * DateCalendar, DateRangeCalendar: switch from rem to px for some internal sizes * CHANGELOG * Use variables when possible * Use theme-aware variables
What?
Switch from
rem
topx
units for some internal sizes (day button size, nav height, months gap).Why?
Until now, the
DateCalendar
andDateRangeCalendar
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
topx
, assuming a16px
base font size.Testing Instructions
Compare Storybook examples on trunk and this PR:
16px