Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
6436944
Block API: Add block visibility control support and UI
t-hamano Aug 8, 2025
c12c3cf
Merge branch 'trunk' into block-visibility
t-hamano Aug 15, 2025
7f8d055
Render hidden block block
t-hamano Aug 15, 2025
52913e1
Remove unused code
t-hamano Aug 15, 2025
a5d0146
Always hide block when it's not selected
t-hamano Aug 18, 2025
c3f7135
Extend existing isBlockVisible selector and use it
t-hamano Aug 18, 2025
5f459c7
Revert "Extend existing isBlockVisible selector and use it"
t-hamano Aug 18, 2025
1a46d6b
Remove SCSS import statement
t-hamano Aug 18, 2025
6577955
Use "isBlockHidden"
t-hamano Aug 18, 2025
19b7b9c
Remove useBlockVisibility hook
t-hamano Aug 18, 2025
b1dad49
useBlockDropZone: Filter out blocks that are hidden
t-hamano Aug 18, 2025
6e42b65
Remove useBlockVisibility hook
t-hamano Aug 18, 2025
7849d2f
Update doc
t-hamano Aug 18, 2025
2bfa54e
Show hidden block placeholder when dragging
t-hamano Aug 18, 2025
913ad06
Revert "Show hidden block placeholder when dragging"
t-hamano Aug 19, 2025
8c5c625
Show block toolbar button only when editing mode is default
t-hamano Aug 19, 2025
d8dd684
Merge branch 'trunk' into block-visibility
t-hamano Aug 25, 2025
fb2d668
Process metadata updates for multiple blocks at once
t-hamano Aug 25, 2025
03c1826
Preserve block visibility metadata in block transforms
t-hamano Aug 25, 2025
9c12705
Merge branch 'trunk' into block-visibility
t-hamano Sep 16, 2025
a78bdd5
Remove support from schema and docs
t-hamano Sep 16, 2025
599ed80
Add experiments setting
t-hamano Sep 16, 2025
6c04b64
Make Block Visibility as experiment feature
t-hamano Sep 16, 2025
e54603e
Rename __experimentalBlockVisibility to blockVisibility
t-hamano Sep 18, 2025
854b5d5
Merge branch 'trunk' into block-visibility
t-hamano Sep 30, 2025
3b152ca
Fix: other metadata attributes get stripped when toggling via the too…
t-hamano Sep 30, 2025
fffcf35
Show block toolbar button when multiple blocks are selected
t-hamano Sep 30, 2025
1c9b407
Fix incorrect block.json definition
t-hamano Sep 30, 2025
5596f83
Apply opacity to hidden and selected blocks
t-hamano Sep 30, 2025
c39d72a
Revert "Apply opacity to hidden and selected blocks"
t-hamano Sep 30, 2025
7de5b65
Provide blockVilibility metadata to preview context
t-hamano Sep 30, 2025
f773c15
Accordion Header, Accordion Panel: disable blockVisibility support
t-hamano Sep 30, 2025
f36f529
Visually hide block
t-hamano Sep 30, 2025
f5c1572
Merge branch 'trunk' into block-visibility
t-hamano Oct 1, 2025
bb9ec37
Stabilize feature
t-hamano Oct 1, 2025
4c7338c
Add backport changelog
t-hamano Oct 1, 2025
861689c
Update server side function
t-hamano Oct 1, 2025
0929559
Use "visibility:hidden" to visually hide blocks
t-hamano Oct 1, 2025
dd0d1cb
Combine multiple useSelect call into one
t-hamano Oct 1, 2025
96428fd
Reset styles from hidden blocks
t-hamano Oct 1, 2025
465777d
Update lib/block-supports/block-visibility.php
t-hamano Oct 1, 2025
ff7a8d5
Better behavior for hidden blocks
t-hamano Oct 1, 2025
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
Prev Previous commit
Better behavior for hidden blocks
  • Loading branch information
t-hamano committed Oct 1, 2025
commit ff7a8d55919796d5b4b9165cdb426538a7d25077
30 changes: 19 additions & 11 deletions packages/block-editor/src/components/block-list/content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,25 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection="true"] .b
}
}


// Hidden blocks.
// In order for the block toolbar to render correctly, blocks cannot be hidden.
// Instead, use styles to visually hide blocks.
.block-editor-block-list__block.is-block-hidden {
visibility: hidden;
overflow: hidden;
height: 0;
border: none !important;
padding: 0 !important;
}

&.is-layout-flex:not(.is-vertical) > .is-block-hidden {
width: 0;
height: auto;
align-self: stretch;
white-space: nowrap !important;
}

// Re-enable it on components inside.
[class^="components-"] {
user-select: text;
Expand Down Expand Up @@ -187,17 +206,6 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection="true"] .b
&[data-clear="true"] {
float: none;
}

// Hidden blocks.
// In order for the block toolbar to render correctly, blocks cannot be hidden.
// Instead, use styles to visually hide blocks.
&.is-block-hidden {
visibility: hidden !important;
height: 0 !important;
overflow: hidden !important;
border: none !important;
padding: 0 !important;
}
}

.is-outline-mode .block-editor-block-list__block:not(.remove-outline) {
Expand Down
Loading