diff --git a/packages/block-library/src/social-link/editor.scss b/packages/block-library/src/social-link/editor.scss index e938b8d74ee749..1d9bde20f72436 100644 --- a/packages/block-library/src/social-link/editor.scss +++ b/packages/block-library/src/social-link/editor.scss @@ -1,9 +1,20 @@ -.wp-block-social-links .wp-social-link button { - color: currentColor; - padding: 6px; +// The editor uses the button component, the frontend uses a link. +// Therefore we unstyle the button component to make it more like the frontend. +.wp-block-social-links .wp-social-link { + line-height: 0; + + button { + font-size: inherit; + color: currentColor; + height: auto; + line-height: 0; + + // This rule is duplicated from the style.scss and needs to be the same as there. + padding: 0.25em; + } } .wp-block-social-links.is-style-pill-shape .wp-social-link button { - padding-left: 16px; - padding-right: 16px; + padding-left: calc((2/3) * 1em); + padding-right: calc((2/3) * 1em); } diff --git a/packages/block-library/src/social-links/block.json b/packages/block-library/src/social-links/block.json index d0ed132031b912..47147dee69c89b 100644 --- a/packages/block-library/src/social-links/block.json +++ b/packages/block-library/src/social-links/block.json @@ -6,6 +6,9 @@ "openInNewTab": { "type": "boolean", "default": false + }, + "size": { + "type": "string" } }, "providesContext": { diff --git a/packages/block-library/src/social-links/edit.js b/packages/block-library/src/social-links/edit.js index 13ce364c83561b..b8b9136a6fdcdb 100644 --- a/packages/block-library/src/social-links/edit.js +++ b/packages/block-library/src/social-links/edit.js @@ -1,3 +1,8 @@ +/** + * External dependencies + */ +import classNames from 'classnames'; + /** * WordPress dependencies */ @@ -5,30 +10,48 @@ import { Fragment } from '@wordpress/element'; import { + BlockControls, __experimentalUseInnerBlocksProps as useInnerBlocksProps, useBlockProps, InspectorControls, } from '@wordpress/block-editor'; -import { ToggleControl, PanelBody } from '@wordpress/components'; +import { + DropdownMenu, + MenuGroup, + MenuItem, + PanelBody, + ToggleControl, + ToolbarItem, + ToolbarGroup, +} from '@wordpress/components'; import { __ } from '@wordpress/i18n'; +import { check } from '@wordpress/icons'; const ALLOWED_BLOCKS = [ 'core/social-link' ]; +const sizeOptions = [ + { name: __( 'Small' ), value: 'has-small-icon-size' }, + { name: __( 'Normal' ), value: 'has-normal-icon-size' }, + { name: __( 'Large' ), value: 'has-large-icon-size' }, + { name: __( 'Huge' ), value: 'has-huge-icon-size' }, +]; + export function SocialLinksEdit( props ) { const { - attributes: { openInNewTab }, + attributes: { size, openInNewTab }, setAttributes, } = props; const SocialPlaceholder = (