-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make the editor canvas friendly towards colored backgrounds #6406
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,7 +67,7 @@ | |
|
||
// This is a focus style shown for blocks that need an indicator even when in an isEditing state | ||
// like for example an image block that receives arrowkey focus. | ||
.edit-post-visual-editor .editor-block-list__block:not( .is-selected ) { | ||
.edit-post-visual-editor .editor-block-list__block:not( .is-selected ):not( [data-type="core/paragraph"] ) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not paragraphs? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good question. This branch has been around long enough that I don't recall adding this — could it have come in as part of a rebase and later been removed? In any case I removed it again becaues I couldn't see any regressions as a result. |
||
.editor-block-list__block-edit { | ||
box-shadow: 0 0 0 0 $white, 0 0 0 0 $dark-gray-900; | ||
transition: .1s box-shadow .05s; | ||
|
@@ -86,6 +86,7 @@ | |
.editor-post-permalink { | ||
left: $block-padding; | ||
right: $block-padding; | ||
color: $dark-gray-900; | ||
} | ||
|
||
@include break-small() { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
.components-draggable__clone { | ||
& > .editor-block-list__block > .editor-block-list__block-draggable { | ||
background: $white; | ||
background: $white; // @todo: ensure this works with themes that invert the color | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Has this been done? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, and I'm not sure that this can be done. At least I'm open to ideas here. The thing is, the draggable clone has to have a background, or you can see the text below through it. It would be nice if we could eyedrop the color of the |
||
box-shadow: $shadow-popover; | ||
|
||
@include break-small { | ||
|
@@ -33,9 +33,15 @@ | |
right: 0; | ||
bottom: 0; | ||
left: 0; | ||
background-color: $light-gray-200; | ||
visibility: hidden; | ||
|
||
// use opacity to work in various editor styles | ||
background-color: $dark-opacity-light-200; | ||
|
||
.is-dark-theme & { | ||
background-color: $light-opacity-light-200; | ||
} | ||
|
||
@include break-small { | ||
margin: 0 48px; | ||
} | ||
|
@@ -57,7 +63,7 @@ | |
} | ||
|
||
|
||
cursor: move;/* Fallback for IE/Edge < 14 */ | ||
cursor: move; // Fallback for IE/Edge < 14 | ||
cursor: grab; | ||
} | ||
|
||
|
@@ -168,16 +174,26 @@ | |
top: 10px; | ||
} | ||
|
||
&.is-selected > .editor-block-mover:before, | ||
&.is-hovered > .editor-block-mover:before { | ||
border-right: 1px solid $light-gray-500; | ||
right: 0; | ||
|
||
// use opacity to work in various editor styles | ||
border-right: 1px solid $dark-opacity-light-500; | ||
|
||
.is-dark-theme & { | ||
border-right: 1px solid $light-opacity-light-500; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
} | ||
} | ||
|
||
&.is-selected > .editor-block-settings-menu:before, | ||
&.is-hovered > .editor-block-settings-menu:before { | ||
border-left: 1px solid $light-gray-500; | ||
left: 0; | ||
|
||
// use opacity to work in various editor styles | ||
border-left: 1px solid $dark-opacity-light-500; | ||
|
||
.is-dark-theme & { | ||
border-left: 1px solid $light-opacity-light-500; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
} | ||
} | ||
|
||
&.is-typing .editor-block-list__empty-block-inserter, | ||
|
@@ -213,7 +229,12 @@ | |
|
||
// focused block-style | ||
&.is-selected > .editor-block-list__block-edit:before { | ||
outline: 1px solid $light-gray-500; | ||
// use opacity to work in various editor styles | ||
outline: 1px solid $dark-opacity-light-500; | ||
|
||
.is-dark-theme & { | ||
outline: 1px solid $light-opacity-light-500; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
} | ||
} | ||
|
||
/** | ||
|
@@ -235,6 +256,13 @@ | |
|
||
&.is-multi-selected .editor-block-list__block-edit:before { | ||
background: $blue-medium-highlight; | ||
|
||
// use opacity to work in various editor styles | ||
mix-blend-mode: multiply; | ||
|
||
.is-dark-theme & { | ||
mix-blend-mode: soft-light; | ||
} | ||
} | ||
|
||
/** | ||
|
@@ -250,7 +278,12 @@ | |
} | ||
|
||
&.is-shared > .editor-block-list__block-edit:before { | ||
outline: 1px dashed $light-gray-500; | ||
// use opacity to work in various editor styles | ||
outline: 1px dashed $dark-opacity-light-500; | ||
|
||
.is-dark-theme & { | ||
outline: 1px dashed $light-opacity-light-500; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
} | ||
} | ||
|
||
/** | ||
|
@@ -501,11 +534,6 @@ | |
margin: $item-spacing; | ||
cursor: move;/* Fallback for IE/Edge < 14 */ | ||
cursor: grab; | ||
|
||
.editor-inserter__toggle { | ||
color: $dark-gray-300; | ||
margin: 4px 0 0 -4px; // align better with text blocks | ||
} | ||
} | ||
|
||
.editor-block-list__insertion-point { | ||
|
@@ -652,10 +680,18 @@ | |
|
||
.editor-block-contextual-toolbar .editor-block-toolbar, | ||
.editor-block-list__breadcrumb .components-toolbar { | ||
border: 1px solid $light-gray-500; | ||
width: 100%; | ||
background: $white; | ||
|
||
// use opacity to work in various editor styles | ||
background-clip: padding-box; | ||
box-sizing: padding-box; | ||
border: 1px solid $dark-opacity-light-500; | ||
|
||
.is-dark-theme & { | ||
border: 1px solid $light-opacity-light-500; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
} | ||
|
||
// this prevents floats from messing up the position | ||
position: absolute; | ||
left: 0; | ||
|
@@ -665,16 +701,15 @@ | |
right: 0; | ||
} | ||
|
||
// remove stacked borders in inline toolbar | ||
> div:first-child { | ||
margin-left: -1px; | ||
} | ||
|
||
@include break-small() { | ||
width: auto; | ||
} | ||
} | ||
|
||
.editor-block-contextual-toolbar .editor-block-toolbar { | ||
border-bottom: none; | ||
} | ||
|
||
.editor-block-list__breadcrumb .components-toolbar { | ||
padding: 0px 12px; | ||
line-height: $block-toolbar-height - 1px; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,5 +24,8 @@ | |
|
||
.editor-block-toolbar .editor-block-switcher { | ||
display: inline-flex; | ||
border-left: 1px solid $light-gray-500; | ||
} | ||
|
||
.edit-post-header-toolbar__block-toolbar & { | ||
border-left: 1px solid $light-gray-500; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing a new line at the end of the file here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not certain why this change was required but it broke the PlainText inside blocks (code block for instance). It should be fixed by this though #6844