Skip to content

Commit

Permalink
WP 5.4 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
shramee committed Mar 16, 2020
1 parent da690af commit 576d890
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 30 deletions.
2 changes: 1 addition & 1 deletion assets/blocks.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/blocks.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 1 addition & 12 deletions assets/blocks.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ $caxton-width: 1060px;
.rich-text {
min-width: 100px; // Keep width on the rich text, becomes 0 width and inaccessible without it.
}
.editor-inner-blocks,
.block-editor-inner-blocks,
.editor-block-list__layout,
.block-editor-block-list__layout {
margin: 0;
display: inherit;
Expand Down Expand Up @@ -76,14 +74,13 @@ div, h1, h2, h3, h4, h5, h6, p, blockquote, header, footer, section {
}
}

.block-editor .editor-block-list__block[data-type*='caxton/'],
.block-editor .block-editor-block-list__block[data-type*='caxton/'] {
&, .wp-block {
max-width: $caxton-width;
}
}

.edit-post-visual-editor .editor-block-list__block {
.edit-post-visual-editor .block-editor-block-list__block {
&[data-type="caxton/grid"] {
&:hover {
// Add hover styles here for easy selection
Expand All @@ -96,7 +93,6 @@ div, h1, h2, h3, h4, h5, h6, p, blockquote, header, footer, section {
}
}

.edit-post-visual-editor .editor-block-list__block,
.edit-post-visual-editor .block-editor-block-list__block {
&[caxton-float=" fl"], &[caxton-float=" fr"] {
z-index: 20;
Expand All @@ -107,11 +103,9 @@ div, h1, h2, h3, h4, h5, h6, p, blockquote, header, footer, section {
}

}
&[caxton-float=" fl"] .editor-block-list__block-edit,
&[caxton-float=" fl"] .block-editor-block-list__block-edit {
float: left;
}
&[caxton-float=" fr"] .editor-block-list__block-edit,
&[caxton-float=" fr"] .block-editor-block-list__block-edit {
float: right;
}
Expand Down Expand Up @@ -204,27 +198,22 @@ div, h1, h2, h3, h4, h5, h6, p, blockquote, header, footer, section {
}

// 2018 fix
.editor-styles-wrapper div.wp-block,
.block-editor-styles-wrapper div.wp-block {
width: auto;
}

.editor-block-list__layout .layout-caxton-col .editor-block-list__block,
.block-editor-block-list__layout .layout-caxton-col .block-editor-block-list__block {
padding-left: 36px;
padding-right: 36px;
.editor-block-drop-zone,
.block-editor-block-drop-zone {
margin: 0;
}
.editor-block-list__breadcrumb,
.block-editor-block-list__breadcrumb {
margin-left: -38px;
margin-right: -38px;
}
}

.caxton-columns .editor-block-list__layout.layout-caxton-col,
.caxton-columns .block-editor-block-list__layout.layout-caxton-col {
overflow: visible;
}
Expand Down
16 changes: 1 addition & 15 deletions assets/scss/_caxton-section-grid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,9 @@

.caxton-columns {
grid-template-columns: 100%;
> .editor-inner-blocks > .editor-block-list__layout,
> .block-editor-inner-blocks > .block-editor-block-list__layout {
display: grid;
grid: inherit;
> .editor-block-list__block,
> .block-editor-block-list__block {
margin: 0;
padding: 0;
Expand All @@ -87,14 +85,12 @@
}
.caxton-section-block {
grid-template-columns: 100%;
.editor-block-list__layout,
.block-editor-block-list__layout {
margin: 0;
}
}

@for $i from 1 to 6 {
&.caxton-#{$i}-columns > .editor-inner-blocks > .editor-block-list__layout,
&.caxton-#{$i}-columns > .block-editor-inner-blocks > .block-editor-block-list__layout {
grid-template-columns: repeat($i, 1fr);
}
Expand All @@ -103,26 +99,22 @@
}

.caxton-grid-block {
> .editor-inner-blocks,
> .block-editor-inner-blocks {
grid: inherit;
grid-gap: inherit;
grid-column: 1 / -1;
> .editor-block-list__layout,
> .block-editor-block-list__layout {
grid: inherit;
grid-gap: inherit;
grid-column: 1/-1;
display: grid;
margin: 0;
}
.editor-block-list__block,
.block-editor-block-list__block {
margin: 0;
max-width: none;
}
}
.editor-inner-blocks + .editor-inserter,
.block-editor-inner-blocks + .block-editor-inserter {
position: absolute;
bottom: 0;
Expand All @@ -134,8 +126,7 @@
border-radius: 50%;
}
}
.editor-block-list__block:not(:last-child) .editor-inner-blocks + .editor-inserter,
.block-editor-block-list__block:not(:last-child) .editor-inner-blocks + .block-editor-inserter {
.block-editor-block-list__block:not(:last-child) .block-editor-inner-blocks + .block-editor-inserter {
display: none;
}

Expand All @@ -153,7 +144,6 @@
background: rgba(0,0,0,0);
box-shadow: inset 0 0 1px 1px rgba(0,0,0,0.07);
}
> .editor-block-list__block-edit,
> .block-editor-block-list__block-edit {
height: calc( 100% - 64px );
> [data-block] {
Expand All @@ -170,18 +160,15 @@
}
}

.edit-post-visual-editor .editor-block-list__block[data-type='caxton/section'] > .editor-block-list__block-edit,
.edit-post-visual-editor .block-editor-block-list__block[data-type='caxton/section'] > .block-editor-block-list__block-edit {
margin: 0;
height: 100%;
}

[data-type='caxton/grid'] > .editor-block-list__block-edit > .editor-block-list__breadcrumb,
[data-type='caxton/grid'] > .block-editor-block-list__block-edit > .block-editor-block-list__breadcrumb {
display: none !important;
}

.editor-block-list__block[data-type='caxton/grid']:hover > .editor-block-list__block-edit:after,
.block-editor-block-list__block[data-type='caxton/grid']:hover > .block-editor-block-list__block-edit:after {
content: "Caxton Layout";
display: block;
Expand All @@ -199,7 +186,6 @@
opacity: 1;
}

.editor-block-list__layout .editor-block-list__block[data-type='caxton/grid']:hover > .editor-block-list__block-edit:before,
.block-editor-block-list__layout .block-editor-block-list__block[data-type='caxton/grid']:hover > .block-editor-block-list__block-edit:before {
outline: 1px solid #007cba;
outline-offset: 2px;
Expand Down
2 changes: 1 addition & 1 deletion inc/class-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ private function hide_disable_blocks() {
if ( $disabled_blocks ) {
?>
<style id="caxton-hidden-block-styles">
.editor-block-list-item-<?php echo str_replace( '/', '-', implode( ', .editor-block-list-item-', $disabled_blocks ) ); ?> {
.block-editor-block-list-item-<?php echo str_replace( '/', '-', implode( ', .block-editor-block-list-item-', $disabled_blocks ) ); ?> {
display: none !important;
}
</style>
Expand Down

0 comments on commit 576d890

Please sign in to comment.