Skip to content

Commit 49d007c

Browse files
committed
fix scheme preview
1 parent 1026dff commit 49d007c

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

src/components/color-scheme-preview/editor.scss

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@
4747
grid-template-columns: repeat(2, 1fr);
4848
overflow-y: scroll;
4949
height: 235px;
50+
.stk-global-color-scheme__preview {
51+
display: grid;
52+
}
5053

5154
.stk-global-color-scheme__preview__background {
5255
outline: 1px solid #e0e0e0;
@@ -55,16 +58,19 @@
5558

5659
.stk-global-color-scheme__preview {
5760
position: relative;
58-
&::before {
59-
content: "\f543";
60-
font-family: dashicons;
61-
font-size: 22px;
62-
position: absolute;
63-
top: 50%;
64-
left: 50%;
65-
transform: translate(-50%, -50%);
66-
color: #333;
67-
}
61+
flex-shrink: 0;
62+
display: flex;
63+
}
64+
65+
.stk-global-color-scheme__preview:has(.stk-scheme--is-disabled)::before {
66+
content: "\f543";
67+
font-family: dashicons;
68+
font-size: 22px;
69+
position: absolute;
70+
top: 50%;
71+
left: 50%;
72+
transform: translate(-50%, -50%);
73+
color: #333;
6874
}
6975

7076
.stk-scheme--is-disabled {

src/plugins/global-settings/color-schemes/color-scheme-picker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ const ColorSchemePicker = props => {
315315
buttonOutlineColor: getInheritedValue( item.colorScheme.buttonOutlineColor ) || defaults.buttonOutlineColor.desktop,
316316
}
317317

318-
const isDisabled = ! schemeHasValue( item.colorScheme ) || withWrapper
318+
const isDisabled = withWrapper ? false : ! schemeHasValue( item.colorScheme )
319319
const Preview = <ColorSchemePreview colors={ colors } withWrapper={ withWrapper } isDisabled={ isDisabled } />
320320

321321
return withWrapper ? <div

0 commit comments

Comments
 (0)