diff --git a/packages/components/src/dropdown-menu/index.js b/packages/components/src/dropdown-menu/index.js
index 481d84a6589f4..481e87cd102b7 100644
--- a/packages/components/src/dropdown-menu/index.js
+++ b/packages/components/src/dropdown-menu/index.js
@@ -91,6 +91,9 @@ function DropdownMenu( dropdownMenuProps ) {
onToggle();
}
};
+ const { as: Toggle = Button, ...restToggleProps } =
+ toggleProps ?? {};
+
const mergedToggleProps = mergeProps(
{
className: classnames(
@@ -100,11 +103,11 @@ function DropdownMenu( dropdownMenuProps ) {
}
),
},
- toggleProps
+ restToggleProps
);
return (
-
+
);
} }
renderContent={ ( props ) => {
diff --git a/packages/edit-site/src/components/add-new-template/new-template-part.js b/packages/edit-site/src/components/add-new-template/new-template-part.js
index 8c3aa84b11974..82e90f248b4f9 100644
--- a/packages/edit-site/src/components/add-new-template/new-template-part.js
+++ b/packages/edit-site/src/components/add-new-template/new-template-part.js
@@ -86,11 +86,12 @@ export default function NewTemplatePart( {
setIsModalOpen( false );
}
}
+ const { as: Toggle = Button, ...restToggleProps } = toggleProps ?? {};
return (
<>
-
+
{ isModalOpen && (
setIsModalOpen( false ) }
diff --git a/packages/edit-site/src/components/sidebar-button/index.js b/packages/edit-site/src/components/sidebar-button/index.js
new file mode 100644
index 0000000000000..9da8492c37c79
--- /dev/null
+++ b/packages/edit-site/src/components/sidebar-button/index.js
@@ -0,0 +1,21 @@
+/**
+ * External dependencies
+ */
+import classnames from 'classnames';
+
+/**
+ * WordPress dependencies
+ */
+import { Button } from '@wordpress/components';
+
+export default function SidebarButton( props ) {
+ return (
+
+ );
+}
diff --git a/packages/edit-site/src/components/sidebar-button/style.scss b/packages/edit-site/src/components/sidebar-button/style.scss
new file mode 100644
index 0000000000000..a13677ffed8de
--- /dev/null
+++ b/packages/edit-site/src/components/sidebar-button/style.scss
@@ -0,0 +1,23 @@
+.edit-site-sidebar-button {
+ color: $gray-200;
+ flex-shrink: 0;
+
+ // Focus (resets default button focus and use focus-visible).
+ &:focus:not(:disabled) {
+ box-shadow: none;
+ outline: none;
+ }
+ &:focus-visible:not(:disabled) {
+ box-shadow:
+ 0 0 0 var(--wp-admin-border-width-focus)
+ var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));
+ outline: 3px solid transparent;
+ }
+
+ &:hover,
+ &:focus-visible,
+ &:focus,
+ &:not([aria-disabled="true"]):active {
+ color: $white;
+ }
+}
diff --git a/packages/edit-site/src/components/sidebar-navigation-screen-navigation-item/index.js b/packages/edit-site/src/components/sidebar-navigation-screen-navigation-item/index.js
index a65e540a8ad75..f8ce406a45015 100644
--- a/packages/edit-site/src/components/sidebar-navigation-screen-navigation-item/index.js
+++ b/packages/edit-site/src/components/sidebar-navigation-screen-navigation-item/index.js
@@ -3,12 +3,10 @@
*/
import { __ } from '@wordpress/i18n';
import { useDispatch, useSelect } from '@wordpress/data';
-import {
- Button,
- __experimentalUseNavigator as useNavigator,
-} from '@wordpress/components';
+import { __experimentalUseNavigator as useNavigator } from '@wordpress/components';
import { store as coreStore } from '@wordpress/core-data';
import { decodeEntities } from '@wordpress/html-entities';
+import { pencil } from '@wordpress/icons';
/**
* Internal dependencies
@@ -16,6 +14,7 @@ import { decodeEntities } from '@wordpress/html-entities';
import SidebarNavigationScreen from '../sidebar-navigation-screen';
import { unlock } from '../../private-apis';
import { store as editSiteStore } from '../../store';
+import SidebarButton from '../sidebar-button';
export default function SidebarNavigationScreenNavigationItem() {
const { setCanvasMode } = unlock( useDispatch( editSiteStore ) );
@@ -43,13 +42,11 @@ export default function SidebarNavigationScreenNavigationItem() {
setCanvasMode( 'edit' ) }
- >
- { __( 'Edit' ) }
-
+ label={ __( 'Edit' ) }
+ icon={ pencil }
+ />
}
content={
post ? decodeEntities( post?.description?.rendered ) : null
diff --git a/packages/edit-site/src/components/sidebar-navigation-screen-template/index.js b/packages/edit-site/src/components/sidebar-navigation-screen-template/index.js
index 2282c03a78151..86ffc29a9d8ac 100644
--- a/packages/edit-site/src/components/sidebar-navigation-screen-template/index.js
+++ b/packages/edit-site/src/components/sidebar-navigation-screen-template/index.js
@@ -3,7 +3,7 @@
*/
import { __ } from '@wordpress/i18n';
import { useDispatch } from '@wordpress/data';
-import { Button } from '@wordpress/components';
+import { pencil } from '@wordpress/icons';
/**
* Internal dependencies
@@ -12,6 +12,7 @@ import SidebarNavigationScreen from '../sidebar-navigation-screen';
import useEditedEntityRecord from '../use-edited-entity-record';
import { unlock } from '../../private-apis';
import { store as editSiteStore } from '../../store';
+import SidebarButton from '../sidebar-button';
export default function SidebarNavigationScreenTemplate() {
const { setCanvasMode } = unlock( useDispatch( editSiteStore ) );
@@ -27,13 +28,11 @@ export default function SidebarNavigationScreenTemplate() {
setCanvasMode( 'edit' ) }
- >
- { __( 'Edit' ) }
-
+ label={ __( 'Edit' ) }
+ icon={ pencil }
+ />
}
content={ description ? { description }
: undefined }
/>
diff --git a/packages/edit-site/src/components/sidebar-navigation-screen-templates/index.js b/packages/edit-site/src/components/sidebar-navigation-screen-templates/index.js
index 28e31727d9b53..30bfd6aad532f 100644
--- a/packages/edit-site/src/components/sidebar-navigation-screen-templates/index.js
+++ b/packages/edit-site/src/components/sidebar-navigation-screen-templates/index.js
@@ -20,6 +20,7 @@ import { useLink } from '../routes/link';
import SidebarNavigationItem from '../sidebar-navigation-item';
import AddNewTemplate from '../add-new-template';
import { store as editSiteStore } from '../../store';
+import SidebarButton from '../sidebar-button';
const config = {
wp_template: {
@@ -84,8 +85,7 @@ export default function SidebarNavigationScreenTemplates() {
)
diff --git a/packages/edit-site/src/components/sidebar-navigation-screen-templates/style.scss b/packages/edit-site/src/components/sidebar-navigation-screen-templates/style.scss
index 174c7210e8403..432774f903e46 100644
--- a/packages/edit-site/src/components/sidebar-navigation-screen-templates/style.scss
+++ b/packages/edit-site/src/components/sidebar-navigation-screen-templates/style.scss
@@ -2,8 +2,3 @@
/* Overrides the margin that comes from the Item component */
margin-top: $grid-unit-20 !important;
}
-
-.edit-site-sidebar-navigation-screen-templates__add-button {
- /* Overrides the color for all states of the button */
- color: inherit !important;
-}
diff --git a/packages/edit-site/src/components/sidebar-navigation-screen/index.js b/packages/edit-site/src/components/sidebar-navigation-screen/index.js
index 261fd6b91cf56..3632d3d17eb42 100644
--- a/packages/edit-site/src/components/sidebar-navigation-screen/index.js
+++ b/packages/edit-site/src/components/sidebar-navigation-screen/index.js
@@ -5,7 +5,6 @@ import {
__experimentalHStack as HStack,
__experimentalVStack as VStack,
__experimentalNavigatorToParentButton as NavigatorToParentButton,
- Button,
} from '@wordpress/components';
import { isRTL, __ } from '@wordpress/i18n';
import { chevronRight, chevronLeft } from '@wordpress/icons';
@@ -16,6 +15,7 @@ import { useSelect } from '@wordpress/data';
*/
import { store as editSiteStore } from '../../store';
import { unlock } from '../../private-apis';
+import SidebarButton from '../sidebar-button';
export default function SidebarNavigationScreen( {
isRoot,
@@ -39,13 +39,12 @@ export default function SidebarNavigationScreen( {
>
{ ! isRoot ? (
) : (
-