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
32 changes: 7 additions & 25 deletions packages/block-library/src/gallery/deprecated.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,16 @@
figure {
margin: 0;
height: 100%;

// IE doesn't support flex so omit that.
@supports (position: sticky) {
display: flex;
align-items: flex-end;
justify-content: flex-start;
}
display: flex;
align-items: flex-end;
justify-content: flex-start;
}

img {
display: block;
max-width: 100%;
height: auto;

// IE doesn't handle cropping, so we need an explicit width here.
width: 100%;

// IE11 doesn't read rules inside this query. They are applied only to modern browsers.
@supports (position: sticky) {
width: auto;
}
width: auto;
}

figcaption {
Expand Down Expand Up @@ -81,16 +70,9 @@
&.is-cropped .blocks-gallery-item {
a,
img {
// IE11 doesn't support object-fit, so just make sure images aren't skewed.
// The following rules are for all browsers.
width: 100%;

// IE11 doesn't read rules inside this query. They are applied only to modern browsers.
@supports (position: sticky) {
height: 100%;
flex: 1;
object-fit: cover;
}
height: 100%;
flex: 1;
object-fit: cover;
}
}

Expand Down
57 changes: 14 additions & 43 deletions packages/block-library/src/gallery/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,33 +29,20 @@
position: relative;
margin-top: auto;
margin-bottom: auto;
// IE11 doesn't like the "flex-direction: column;" here.
@supports ( position: sticky ) {
flex-direction: column;
}
flex-direction: column;

> div,
> a {
margin: 0;

// Avoid applying flex styles to IE11.
@supports ( position: sticky ) {
flex-direction: column;
flex-grow: 1;
}
flex-direction: column;
flex-grow: 1;
}

img {
display: block;
height: auto;
max-width: 100%;
width: 100%;

// IE doesn't handle cropping, so we need an explicit width here.
// IE11 doesn't read rules inside this query. They are applied only to modern browsers.
@supports ( position: sticky ) {
width: auto;
}
width: auto;
}

figcaption {
Expand All @@ -80,22 +67,15 @@
&.is-style-rounded {
> div,
> a {
// Not supported in IE11.
@supports ( position: sticky ) {
flex: 1 1 auto;
}
flex: 1 1 auto;
}
figcaption {
flex: initial;
background: none;
// Not supported in IE11.
@supports ( position: sticky ) {
flex: initial;
background: none;
color: inherit;
margin: 0;
padding: 10px 10px 9px;
position: relative;
}
color: inherit;
margin: 0;
padding: 10px 10px 9px;
position: relative;
}
}
}
Expand Down Expand Up @@ -127,24 +107,15 @@
align-self: inherit;
> div:not(.components-drop-zone),
> a {
display: block; // Thanks to IE11 not supporting object-fit fall back to display: block.

// Without IE11 object-fit support "display: flex;" here causes distortion of aspect ratio.
@supports ( position: sticky ) {
display: flex;
}
display: flex;
}

a,
img {
width: 100%;

// IE11 doesn't read rules inside this query. They are applied only to modern browsers.
@supports ( position: sticky ) {
flex: 1 0 0%;
height: 100%;
object-fit: cover;
}
flex: 1 0 0%;
height: 100%;
object-fit: cover;
}
}

Expand Down
2 changes: 2 additions & 0 deletions packages/block-library/src/navigation/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ const ALLOWED_BLOCKS = [
'core/page-list',
'core/spacer',
'core/home-link',
'core/site-title',
'core/site-logo',
];

const LAYOUT = {
Expand Down
10 changes: 7 additions & 3 deletions packages/block-library/src/navigation/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,15 +256,19 @@ function render_block_core_navigation( $attributes, $content, $block ) {
$inner_blocks_html = '';
$is_list_open = false;
foreach ( $inner_blocks as $inner_block ) {
if ( ( 'core/navigation-link' === $inner_block->name || 'core/home-link' === $inner_block->name ) && ! $is_list_open ) {
if ( ( 'core/navigation-link' === $inner_block->name || 'core/home-link' === $inner_block->name || 'core/site-title' === $inner_block->name || 'core/site-logo' === $inner_block->name ) && ! $is_list_open ) {
$is_list_open = true;
$inner_blocks_html .= '<ul class="wp-block-navigation__container">';
}
if ( 'core/navigation-link' !== $inner_block->name && 'core/home-link' !== $inner_block->name && $is_list_open ) {
if ( 'core/navigation-link' !== $inner_block->name && 'core/home-link' !== $inner_block->name && 'core/site-title' !== $inner_block->name && 'core/site-logo' !== $inner_block->name && $is_list_open ) {
$is_list_open = false;
$inner_blocks_html .= '</ul>';
}
$inner_blocks_html .= $inner_block->render();
if ( 'core/site-title' === $inner_block->name || 'core/site-logo' === $inner_block->name ) {
$inner_blocks_html .= '<li class="wp-block-navigation-item">' . $inner_block->render() . '</li>';
} else {
$inner_blocks_html .= $inner_block->render();
}
}

if ( $is_list_open ) {
Expand Down
1 change: 1 addition & 0 deletions packages/block-library/src/navigation/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@

.items-justified-space-between .wp-block-navigation__container {
justify-content: space-between;
flex: 1;
}

// Vertical justification.
Expand Down
2 changes: 1 addition & 1 deletion packages/blocks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ add_action( 'enqueue_block_editor_assets', 'random_image_enqueue_block_editor_as

return el(
'form',
Object.assing( blockProps, { onSubmit: setCategory } ),
Object.assign( blockProps, { onSubmit: setCategory } ),
children
);
},
Expand Down