(
+
+
+
+ ) }
+ />
+ );
+};
+
+function renderShadowToggle() {
+ return ( { onToggle, isOpen } ) => {
+ const toggleProps = {
+ onClick: onToggle,
+ className: classnames( { 'is-open': isOpen } ),
+ 'aria-expanded': isOpen,
+ };
+
+ return (
+
+ );
+ };
+}
+
+function ShadowPopoverContainer( { shadow, onShadowChange } ) {
+ const [ defaultShadows ] = useSetting( 'shadow.palette.default' );
+ const [ themeShadows ] = useSetting( 'shadow.palette.theme' );
+
+ return (
+
+
+ { __( 'Drop shadows' ) }
+
+
+
+
+ );
+}
+
+function ShadowPresets( { label, presets, activeShadow, onSelect } ) {
+ return ! presets ? null : (
+
+
+ { label }
+
+
+
+ { presets.map( ( { name, shadow }, i ) => (
+
+ onSelect(
+ shadow === activeShadow ? undefined : shadow
+ )
+ }
+ />
+ ) ) }
+
+
+ );
+}
+
+function ShadowIndicator( { label, isActive, onSelect } ) {
+ return (
+
+ );
+}
diff --git a/packages/edit-site/src/components/global-styles/style.scss b/packages/edit-site/src/components/global-styles/style.scss
index 5616a068b594c8..f427c247d5ef56 100644
--- a/packages/edit-site/src/components/global-styles/style.scss
+++ b/packages/edit-site/src/components/global-styles/style.scss
@@ -146,3 +146,36 @@ $block-preview-height: 150px;
max-height: 200px;
overflow-y: scroll;
}
+
+.edit-site-global-styles__shadow-panel {
+ width: 230px;
+}
+
+.edit-site-global-styles__shadow-dropdown {
+ display: block;
+ padding: 0;
+
+ > button {
+ width: 100%;
+ padding: $grid-unit-10;
+
+ &.is-open {
+ background-color: $gray-100;
+ }
+ }
+}
+
+.edit-site-global-styles__shadow-indicator {
+ color: $gray-800;
+ border: $gray-200 $border-width solid;
+ border-radius: $radius-block-ui;
+ padding: $grid-unit-10;
+ cursor: pointer;
+
+ &.active,
+ &.components-button:active {
+ color: $gray-100;
+ background-color: $gray-900;
+ border-color: $gray-900;
+ }
+}
diff --git a/packages/edit-site/src/components/global-styles/utils.js b/packages/edit-site/src/components/global-styles/utils.js
index 4c9d7bae19f7a1..aca51522a7fa47 100644
--- a/packages/edit-site/src/components/global-styles/utils.js
+++ b/packages/edit-site/src/components/global-styles/utils.js
@@ -61,6 +61,12 @@ export const PRESET_METADATA = [
valueFunc: ( { slug } ) => `url( '#wp-duotone-${ slug }' )`,
classes: [],
},
+ {
+ path: [ 'shadow', 'palette' ],
+ valueKey: 'shadow',
+ cssVarInfix: 'shadow',
+ classes: [],
+ },
{
path: [ 'typography', 'fontSizes' ],
valueFunc: ( preset, { typography: typographySettings } ) =>
@@ -96,6 +102,7 @@ const STYLE_PATH_TO_CSS_VAR_INFIX = {
'elements.heading.backgroundColor': 'background-color',
'elements.heading.gradient': 'gradient',
'color.gradient': 'gradient',
+ shadow: 'shadow',
'typography.fontSize': 'font-size',
'typography.fontFamily': 'font-family',
};