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 @@ -11,6 +11,7 @@

### Enhancements

- `CheckboxControl`: Keep the default checkbox at 16px on narrow screens while retaining a 24px click target ([#83612](https://github.com/WordPress/gutenberg/pull/83612)).
- `InputControl`, `SelectControl`, `CustomSelectControl`: Darken the field border on hover to the active stroke color used by `@wordpress/ui`. Disabled and borderless fields keep their resting border ([#83306](https://github.com/WordPress/gutenberg/pull/83306)).
- `TextControl`: Use the `@wordpress/ui` disabled text, placeholder, and border colors, and keep the field background instead of the gray disabled fill from wp-admin ([#83307](https://github.com/WordPress/gutenberg/pull/83307)).

Expand Down
18 changes: 12 additions & 6 deletions packages/components/src/checkbox-control/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@
@use "../utils/theme-variables" as *;

.components-checkbox-control {
// Careful, these CSS vars have experimental overrides in Data Views (packages/dataviews/src/style.scss).
--checkbox-input-size: 24px; // Width & height for small viewports.

@include break-small() {
--checkbox-input-size: 16px;
}
--checkbox-input-size: 16px;

--checkbox-input-margin: #{$grid-unit-10};
}
Expand All @@ -36,6 +31,7 @@
padding: 0 !important;
text-align: center;
vertical-align: top;
position: relative;
width: var(--checkbox-input-size);
height: var(--checkbox-input-size);

Expand All @@ -61,6 +57,16 @@
&:checked::before {
content: none;
}

&::after {
content: "";
position: absolute;
top: 50%;
left: 50%;
width: max(var(--checkbox-input-size), #{$grid-unit-30});
aspect-ratio: 1;
transform: translate(-50%, -50%);
}
}

.components-checkbox-control__input-container {
Expand Down
4 changes: 4 additions & 0 deletions packages/dataviews/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Enhancements

- Selection checkboxes stay visually 16px on narrow screens while retaining a 24px click target ([#83612](https://github.com/WordPress/gutenberg/pull/83612)).

### Documentation

- Document that a custom `sort` receives the field values returned by `getValue`, not the items ([#83483](https://github.com/WordPress/gutenberg/pull/83483)).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ export function BulkSelectionCheckbox< Item >( {
if ( disableSelectAll ) {
return (
<WCCheckboxControl
className="dataviews-view-table-selection-checkbox"
checked={ hasSelection }
disabled={ ! hasSelection }
onChange={ () => {
Expand All @@ -132,7 +131,6 @@ export function BulkSelectionCheckbox< Item >( {

return (
<WCCheckboxControl
className="dataviews-view-table-selection-checkbox"
checked={ areAllSelected }
indeterminate={ ! areAllSelected && !! selectedItems.length }
onChange={ () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,13 +267,6 @@
}


.dataviews-view-table-selection-checkbox {
Comment thread
mirka marked this conversation as resolved.
Resolved
--checkbox-input-size: 24px;
@include break-small() {
--checkbox-input-size: 16px;
}
}

.dataviews-column-primary__media {
max-width: 60px;
min-width: var(--wpds-dimension-size-md);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ function BulkSelectionCheckbox< Item >( {
if ( disableSelectAll ) {
return (
<WCCheckboxControl
className="dataviews-view-table-selection-checkbox"
checked={ hasSelection }
disabled={ ! hasSelection }
onChange={ () => {
Expand All @@ -61,7 +60,6 @@ function BulkSelectionCheckbox< Item >( {

return (
<WCCheckboxControl
className="dataviews-view-table-selection-checkbox"
checked={ areAllSelected }
indeterminate={ ! areAllSelected && !! selectedItems.length }
onChange={ () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
@use "@wordpress/base-styles/mixins" as *;

.dataviews-selection-checkbox {
// Experimental override for CheckboxControl size (fragile)
--checkbox-input-size: 24px;
@include break-small() {
--checkbox-input-size: 16px;
}

line-height: 0;
flex-shrink: 0;

Expand Down
Loading