Color UI component: reorder palettes and update names (core by defaults, user by custom)#36622
Color UI component: reorder palettes and update names (core by defaults, user by custom)#36622
Conversation
|
Size Change: +112 B (0%) Total Size: 1.1 MB
ℹ️ View Unchanged
|
d0c7933 to
936c2c8
Compare
|
|
||
| colorGradientSettings.colors = useMemo( () => { | ||
| const result = []; | ||
| if ( shouldDisplayCoreColors && coreColors && coreColors.length ) { |
There was a problem hiding this comment.
Per the mockups, the order in which the palettes should be shown is: defaults, theme, user.
| ); | ||
| colorGradientSettings.gradients = useMemo( () => { | ||
| const result = []; | ||
| if ( |
There was a problem hiding this comment.
Per the mockups, the order in which the palettes should be shown is: defaults, theme, user.
| const [ defaultColors ] = useSetting( 'color.palette.core', name ); | ||
| return useMemo( () => { | ||
| const result = []; | ||
| if ( coreColors && coreColors.length ) { |
There was a problem hiding this comment.
Per the mockups, the order of teh palettes is: theme, defaults, custom.
| const [ defaultGradients ] = useSetting( 'color.gradients.core', name ); | ||
| return useMemo( () => { | ||
| const result = []; | ||
| if ( coreGradients && coreGradients.length ) { |
There was a problem hiding this comment.
Per the mockups, the order of teh palettes is: theme, defaults, custom.
Mamaduka
left a comment
There was a problem hiding this comment.
Thanks, @oandregal.
The changes look good to me, and the new order matches the mockups
| 'corePalette' => null, | ||
| 'coreGradients' => null, |
There was a problem hiding this comment.
I assume these settings were only recently introduced, which is why we don't need migrations.
There was a problem hiding this comment.
I have tested this manually by viewing the palettes in the global styles sidebar, site editor, and in the block editor.
This works well, I am very glad the use of "Core" was replaced.
I then removed the two default palettes using the new names in theme.json.
The default palettes are removed from the site editor and block editor, but not from the global styles, is that correct?
--
I have one related question, that should not be a blocker for this PR. The border color option only displays the custom color palette, is that correct?
|
@carolinan Thanks for the thorough testing, it's really helpful. Apparently, we missed using those flags in the site editor, I'll get that fixed. Need to investigate the border-color issue. |
|
#36639 fixes the flags in the GS sidebar. |
…ts, user by custom) (#36622)
Based on #36496
Part of #36543 and #36556
In working with the new color UI component to show three different palettes we used these mockups #34574 which use the following names:
This PR updates:
corePaletteandcoreGradientsflags intheme.jsonto bedefaultPaletteanddefaultGradientsinstead.Follow-ups:
default,theme, anduserinstead ofcore,theme, anduser. I'd like to address this as a follow-up to control the PR size. This matters because they're part of the API we expose inuseSetting( 'color.palette.core' )so it should be coherent with the UI for simplicity.