Skip to content

Commit

Permalink
Display classic theme color and gradient palettes
Browse files Browse the repository at this point in the history
  • Loading branch information
tellthemachines committed Nov 18, 2024
1 parent 628d15c commit c3b5a7e
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion packages/edit-site/src/classic-stylebook.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { useResizeObserver } from '@wordpress/compose';
import {
store as blockEditorStore,
BlockEditorProvider,
__experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients,
} from '@wordpress/block-editor';
import { __ } from '@wordpress/i18n';

Expand Down Expand Up @@ -49,7 +50,19 @@ function ClassicStylebookLayout() {
[]
);

const examples = getExamples();
const { colors, gradients } = useMultipleOriginColorsAndGradients();
// Exclude the default colors and gradients.
const themeColors = colors?.filter( ( color ) => color.slug === 'theme' );
const themeGradients = gradients?.filter(
( gradient ) => gradient.slug === 'theme'
);

const examples = getExamples( {
colors: themeColors,
gradients: themeGradients,
duotones: [], // Classic themes don't support duotone palettes.
} );

// Dedupe the examples as they include all categories with repeat sections.
const examplesForSinglePageUse = getExamplesForSinglePageUse( examples );

Expand Down

0 comments on commit c3b5a7e

Please sign in to comment.