diff --git a/packages/edit-site/src/components/global-styles/preview-typography.js b/packages/edit-site/src/components/global-styles/preview-typography.js index 0f9c721996d707..1a6fe29dc4983c 100644 --- a/packages/edit-site/src/components/global-styles/preview-typography.js +++ b/packages/edit-site/src/components/global-styles/preview-typography.js @@ -50,6 +50,11 @@ export default function PreviewTypography( { fontSize, variation } ) { delay: 0.3, type: 'tween', } } + style={ { + fontSize: '22px', + lineHeight: '44px', + textAlign: 'center', + } } > { _x( 'A', 'Uppercase letter A' ) } diff --git a/packages/edit-site/src/components/global-styles/variations/variations-color.js b/packages/edit-site/src/components/global-styles/variations/variations-color.js index b12236fd26e5c3..b7aa7f0c0035b7 100644 --- a/packages/edit-site/src/components/global-styles/variations/variations-color.js +++ b/packages/edit-site/src/components/global-styles/variations/variations-color.js @@ -5,25 +5,30 @@ import { __experimentalGrid as Grid, __experimentalVStack as VStack, } from '@wordpress/components'; -import { __ } from '@wordpress/i18n'; /** * Internal dependencies */ -import Subtitle from '../subtitle'; import Variation from './variation'; import StylesPreviewColors from '../preview-colors'; +import { useCurrentMergeThemeStyleVariationsWithUserConfig } from '../../../hooks/use-theme-style-variations/use-theme-style-variations-by-property'; -export default function ColorVariations( { variations } ) { +export default function ColorVariations() { + const colorVariations = useCurrentMergeThemeStyleVariationsWithUserConfig( { + property: 'color', + filter: ( variation ) => + variation?.settings?.color && + Object.keys( variation?.settings?.color ).length, + } ); return ( - { __( 'Presets' ) } - { variations.map( ( variation, index ) => ( - - { () => } - - ) ) } + { colorVariations && + colorVariations.map( ( variation, index ) => ( + + { () => } + + ) ) } ); diff --git a/packages/edit-site/src/components/global-styles/variations/variations-typography.js b/packages/edit-site/src/components/global-styles/variations/variations-typography.js index 78c0b7d94f0b8e..8ff53c9e0ef6ff 100644 --- a/packages/edit-site/src/components/global-styles/variations/variations-typography.js +++ b/packages/edit-site/src/components/global-styles/variations/variations-typography.js @@ -6,7 +6,6 @@ import { __experimentalGrid as Grid, __experimentalVStack as VStack, } from '@wordpress/components'; -import { __ } from '@wordpress/i18n'; import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor'; /** @@ -16,9 +15,9 @@ import { mergeBaseAndUserConfigs } from '../global-styles-provider'; import { unlock } from '../../../lock-unlock'; import { useCurrentMergeThemeStyleVariationsWithUserConfig } from '../../../hooks/use-theme-style-variations/use-theme-style-variations-by-property'; import PreviewTypography from '../preview-typography'; -import Subtitle from '../subtitle'; import { getFontFamilies } from '../utils'; import Variation from './variation'; +import PreviewIframe from '../preview-iframe'; const { GlobalStylesContext } = unlock( blockEditorPrivateApis ); @@ -63,7 +62,6 @@ export default function TypographyVariations() { return ( - { __( 'Presets' ) } ( { () => ( - + + { () => } + ) } ) ) diff --git a/packages/edit-site/src/components/sidebar-navigation-screen-global-styles/index.js b/packages/edit-site/src/components/sidebar-navigation-screen-global-styles/index.js index a064e9f587853d..3e4283b87abb15 100644 --- a/packages/edit-site/src/components/sidebar-navigation-screen-global-styles/index.js +++ b/packages/edit-site/src/components/sidebar-navigation-screen-global-styles/index.js @@ -5,7 +5,10 @@ import { __ } from '@wordpress/i18n'; import { edit, seen } from '@wordpress/icons'; import { useSelect, useDispatch } from '@wordpress/data'; import { store as coreStore } from '@wordpress/core-data'; -import { __experimentalNavigatorButton as NavigatorButton } from '@wordpress/components'; +import { + __experimentalNavigatorButton as NavigatorButton, + __experimentalVStack as VStack, +} from '@wordpress/components'; import { useViewportMatch } from '@wordpress/compose'; import { BlockEditorProvider } from '@wordpress/block-editor'; import { useCallback } from '@wordpress/element'; @@ -24,6 +27,8 @@ import SidebarNavigationItem from '../sidebar-navigation-item'; import StyleBook from '../style-book'; import useGlobalStylesRevisions from '../global-styles/screen-revisions/use-global-styles-revisions'; import SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer'; +import ColorVariations from '../global-styles/variations/variations-color'; +import TypographyVariations from '../global-styles/variations/variations-typography'; const noop = () => {}; @@ -80,7 +85,33 @@ function SidebarNavigationScreenGlobalStylesContent() { onChange={ noop } onInput={ noop } > - + + +
+

+ { __( 'Colors' ) } +

+ +
+
+

+ { __( 'Typography' ) } +

+ +
+
); }