Commit 936c2c8 1 parent cedf0e4 commit 936c2c8 Copy full SHA for 936c2c8
File tree 2 files changed +24
-24
lines changed
block-editor/src/components/colors-gradients
edit-site/src/components/global-styles
2 files changed +24
-24
lines changed Original file line number Diff line number Diff line change @@ -179,6 +179,12 @@ const PanelColorGradientSettingsMultipleSelect = ( props ) => {
179
179
180
180
colorGradientSettings . colors = useMemo ( ( ) => {
181
181
const result = [ ] ;
182
+ if ( themeColors && themeColors . length ) {
183
+ result . push ( {
184
+ name : __ ( 'Theme' ) ,
185
+ colors : themeColors ,
186
+ } ) ;
187
+ }
182
188
if (
183
189
shouldDisplayDefaultColors &&
184
190
defaultColors &&
@@ -189,12 +195,6 @@ const PanelColorGradientSettingsMultipleSelect = ( props ) => {
189
195
colors : defaultColors ,
190
196
} ) ;
191
197
}
192
- if ( themeColors && themeColors . length ) {
193
- result . push ( {
194
- name : __ ( 'Theme' ) ,
195
- colors : themeColors ,
196
- } ) ;
197
- }
198
198
if ( customColors && customColors . length ) {
199
199
result . push ( {
200
200
name : __ ( 'Custom' ) ,
@@ -212,6 +212,12 @@ const PanelColorGradientSettingsMultipleSelect = ( props ) => {
212
212
) ;
213
213
colorGradientSettings . gradients = useMemo ( ( ) => {
214
214
const result = [ ] ;
215
+ if ( themeGradients && themeGradients . length ) {
216
+ result . push ( {
217
+ name : __ ( 'Theme' ) ,
218
+ gradients : themeGradients ,
219
+ } ) ;
220
+ }
215
221
if (
216
222
shouldDisplayDefaultGradients &&
217
223
defaultGradients &&
@@ -222,12 +228,6 @@ const PanelColorGradientSettingsMultipleSelect = ( props ) => {
222
228
gradients : defaultGradients ,
223
229
} ) ;
224
230
}
225
- if ( themeGradients && themeGradients . length ) {
226
- result . push ( {
227
- name : __ ( 'Theme' ) ,
228
- gradients : themeGradients ,
229
- } ) ;
230
- }
231
231
if ( customGradients && customGradients . length ) {
232
232
result . push ( {
233
233
name : __ ( 'Custom' ) ,
Original file line number Diff line number Diff line change @@ -223,18 +223,18 @@ export function useColorsPerOrigin( name ) {
223
223
const [ defaultColors ] = useSetting ( 'color.palette.core' , name ) ;
224
224
return useMemo ( ( ) => {
225
225
const result = [ ] ;
226
- if ( defaultColors && defaultColors . length ) {
227
- result . push ( {
228
- name : __ ( 'Default' ) ,
229
- colors : defaultColors ,
230
- } ) ;
231
- }
232
226
if ( themeColors && themeColors . length ) {
233
227
result . push ( {
234
228
name : __ ( 'Theme' ) ,
235
229
colors : themeColors ,
236
230
} ) ;
237
231
}
232
+ if ( defaultColors && defaultColors . length ) {
233
+ result . push ( {
234
+ name : __ ( 'Default' ) ,
235
+ colors : defaultColors ,
236
+ } ) ;
237
+ }
238
238
if ( customColors && customColors . length ) {
239
239
result . push ( {
240
240
name : __ ( 'Custom' ) ,
@@ -251,18 +251,18 @@ export function useGradientsPerOrigin( name ) {
251
251
const [ defaultGradients ] = useSetting ( 'color.gradients.core' , name ) ;
252
252
return useMemo ( ( ) => {
253
253
const result = [ ] ;
254
- if ( defaultGradients && defaultGradients . length ) {
255
- result . push ( {
256
- name : __ ( 'Default' ) ,
257
- gradients : defaultGradients ,
258
- } ) ;
259
- }
260
254
if ( themeGradients && themeGradients . length ) {
261
255
result . push ( {
262
256
name : __ ( 'Theme' ) ,
263
257
gradients : themeGradients ,
264
258
} ) ;
265
259
}
260
+ if ( defaultGradients && defaultGradients . length ) {
261
+ result . push ( {
262
+ name : __ ( 'Default' ) ,
263
+ gradients : defaultGradients ,
264
+ } ) ;
265
+ }
266
266
if ( customGradients && customGradients . length ) {
267
267
result . push ( {
268
268
name : __ ( 'Custom' ) ,
You can’t perform that action at this time.
0 commit comments