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
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function useDarkThemeBodyClassName( styles ) {
// DOM, so calculate the background color by creating a fake
// wrapper.
const tempCanvas = ownerDocument.createElement( 'div' );
tempCanvas.classList.add( EDITOR_STYLES_SELECTOR );
tempCanvas.classList.add( 'editor-styles-wrapper' );
body.appendChild( tempCanvas );

backgroundColor = defaultView
Expand Down
4 changes: 4 additions & 0 deletions packages/edit-widgets/src/blocks/widget-area/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
.block-list-appender.wp-block {
width: initial;
}
// Override theme custom widths for blocks.
.editor-styles-wrapper .wp-block.wp-block.wp-block.wp-block.wp-block {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just do !important here, or would that be too much specificity?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I prefer to go with the lowest specificity option where possible - this should be enough, and it it proves not to be we can always change it to !important later.

max-width: 100%;
}
}

// Add some spacing above the inner blocks so that the block toolbar doesn't
Expand Down
36 changes: 35 additions & 1 deletion packages/widgets/src/blocks/legacy-widget/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
margin: 0 0 $grid-unit-15 0;
}

.widget-inside {
.widget-inside.widget-inside {
border: none;
box-shadow: none;
display: block;
Expand All @@ -25,6 +25,34 @@
label + .widefat {
margin-top: $grid-unit-15;
}

// Override theme style bleed.
label,
input,
a {
color: $black;
}
select {
font-family: system-ui;
-webkit-appearance: revert;
color: revert;
border: revert;
border-radius: revert;
background: revert;
box-shadow: revert;
text-shadow: revert;
outline: revert;
cursor: revert;
transform: revert;
font-size: revert;
line-height: revert;
padding: revert;
margin: revert;
min-height: revert;
max-width: revert;
vertical-align: revert;
font-weight: revert;
}
}

// Reset z-index set on https://github.com/WordPress/wordpress-develop/commit/f26d4d37351a55fd1fc5dad0f5fef8f0f964908c.
Expand All @@ -33,6 +61,12 @@
}
}

// Make sure edit form text and no preview warning are always visible.
.wp-block-legacy-widget__edit-form.wp-block-legacy-widget__edit-form,
.wp-block-legacy-widget__edit-no-preview.wp-block-legacy-widget__edit-no-preview {
color: $black;
}

.wp-block-legacy-widget__edit-preview,
.wp-block-legacy-widget__edit-no-preview {
cursor: pointer;
Expand Down