Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)).
Copy link
Member

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?

Copy link
Contributor Author

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).

Copy link
Member

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 👍

Copy link
Member

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.

Copy link
Contributor Author

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!

Copy link
Member

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 👍


## 30.1.0 (2025-08-07)

Expand Down
44 changes: 22 additions & 22 deletions packages/components/src/calendar/style.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* Root of the component. */
// Internal variables
$wp-components-calendar-outline-focus: var(--wp-admin-border-width-focus) solid $components-color-accent;
$wp-components-calendar-button-height: 2rem;
$wp-components-calendar-button-width: 2rem;
$wp-components-calendar-nav-height: 2rem;
$wp-components-calendar-button-height: $grid-unit-40;
$wp-components-calendar-button-width: $grid-unit-40;
$wp-components-calendar-nav-height: $grid-unit-40;
$wp-components-calendar-range-middle-background-color: color-mix(in srgb, $components-color-accent 4%, transparent);
$wp-components-calendar-preview-border-color: color-mix(in srgb, $components-color-accent 16%, transparent);

Expand All @@ -13,10 +13,10 @@ $wp-components-calendar-preview-border-color: color-mix(in srgb, $components-col
position: relative; /* Required to position the navigation toolbar. */
box-sizing: border-box;
display: inline flow-root;
color: $gray-900;
background-color: $white;
font-size: 13px;
font-weight: 400;
color: $components-color-foreground;
background-color: $components-color-background;
font-size: $font-size-medium;
font-weight: $font-weight-regular;
z-index: 0; // Create a stacking context and render on top of the background.

*,
Expand All @@ -35,7 +35,7 @@ $wp-components-calendar-preview-border-color: color-mix(in srgb, $components-col
// date follows the same color as the button's text, since the button
// inherits its text color.
&:has(.components-calendar__day-button:disabled) {
color: $gray-600;
color: $components-color-disabled;
}
&:has(.components-calendar__day-button:hover:not(:disabled)),
&:has(.components-calendar__day-button:focus-visible) {
Expand All @@ -57,7 +57,7 @@ $wp-components-calendar-preview-border-color: color-mix(in srgb, $components-col
height: $wp-components-calendar-button-height;

border: none;
border-radius: 2px;
border-radius: $radius-small;

font: inherit;
font-variant-numeric: tabular-nums;
Expand All @@ -73,7 +73,7 @@ $wp-components-calendar-preview-border-color: color-mix(in srgb, $components-col
z-index: -1;
inset: 0;
border: none; // No default border to avoid polluting high-contrast mode.
border-radius: 2px;
border-radius: $radius-small;
}

// Use the button's ::after to show the selection preview.
Expand Down Expand Up @@ -117,7 +117,7 @@ $wp-components-calendar-preview-border-color: color-mix(in srgb, $components-col
.components-calendar__button-next,
.components-calendar__button-previous {
border: none;
border-radius: 2px;
border-radius: $radius-small;
background: none;
padding: 0;
margin: 0;
Expand All @@ -139,7 +139,7 @@ $wp-components-calendar-preview-border-color: color-mix(in srgb, $components-col
&[aria-disabled="true"] {
cursor: revert;

color: $gray-600;
color: $components-color-disabled;
}

&:focus-visible {
Expand All @@ -150,8 +150,8 @@ $wp-components-calendar-preview-border-color: color-mix(in srgb, $components-col
.components-calendar__chevron {
display: inline-block;
fill: currentColor;
width: 16px;
height: 16px;
width: $grid-unit-20;
height: $grid-unit-20;
}

.components-calendar[dir="rtl"]
Expand All @@ -167,21 +167,21 @@ $wp-components-calendar-preview-border-color: color-mix(in srgb, $components-col
align-content: center;

height: $wp-components-calendar-nav-height;
margin-bottom: 12px;
margin-bottom: $grid-unit-15;
}

.components-calendar__months {
position: relative;
display: flex;
justify-content: center;
flex-wrap: wrap;
gap: 1rem;
gap: $grid-unit-20;
max-width: fit-content;
}

.components-calendar__month-grid {
border-collapse: separate;
border-spacing: 0 4px;
border-spacing: 0 $grid-unit-05;
}

.components-calendar__nav {
Expand All @@ -202,7 +202,7 @@ $wp-components-calendar-preview-border-color: color-mix(in srgb, $components-col
height: $wp-components-calendar-button-height;
padding: 0;

color: $gray-700;
color: $components-color-gray-700;
text-align: center;
text-transform: uppercase;
}
Expand All @@ -227,24 +227,24 @@ $wp-components-calendar-preview-border-color: color-mix(in srgb, $components-col
.components-calendar__day-button,
.components-calendar__day-button:hover:not(:disabled)
) {
color: $white;
color: $components-color-foreground-inverted;
}

.components-calendar__day-button {
&::before {
background-color: $gray-900;
background-color: $components-color-foreground;
// Render a transparent border to highlight the selected day in
// forced-colors (high-contrast) mode, since the background is not
// visible.
border: 1px solid transparent;
}

&:disabled::before {
background-color: $gray-600;
background-color: $components-color-disabled;
}

&:hover:not(:disabled)::before {
background-color: $gray-800;
background-color: $components-color-gray-800;
}
}
}
Expand Down
1 change: 1 addition & 0 deletions packages/components/src/utils/theme-variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ $components-color-light-gray-placeholder: color-mix(in srgb, $components-color-b

// Semantic aliases (prefer these over raw gray values when applicable).
$components-color-border: #{ $components-color-gray-600 };
$components-color-disabled: #{ $components-color-gray-600 };
Loading