Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace edit icon for text based button in details panel #54365

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/edit-site/src/components/sidebar-button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ export default function SidebarButton( props ) {
'edit-site-sidebar-button',
props.className
) }
/>
>
{ props.children }
</Button>
);
}
17 changes: 16 additions & 1 deletion packages/edit-site/src/components/sidebar-button/style.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.edit-site-sidebar-button {
.edit-site-sidebar-button,
.edit-site-sidebar-button--primary {
color: $gray-200;
flex-shrink: 0;

Expand All @@ -22,3 +23,17 @@
color: $gray-100;
}
}

.edit-site-sidebar-button--primary {
background: $gray-800;
color: $gray-100;

&:hover,
&:focus-visible,
&:focus,
&:not([aria-disabled="true"]):active,
&[aria-expanded="true"] {
background: $gray-700;
color: $white;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
*/
import { __, _x } from '@wordpress/i18n';
import { useDispatch, useSelect } from '@wordpress/data';
import { pencil } from '@wordpress/icons';
import {
__experimentalUseNavigator as useNavigator,
Icon,
Expand Down Expand Up @@ -114,8 +113,10 @@ export default function SidebarNavigationScreenTemplate() {
<SidebarButton
onClick={ () => setCanvasMode( 'edit' ) }
label={ __( 'Edit' ) }
icon={ pencil }
/>
className="edit-site-sidebar-button--primary"
>
{ __( 'Edit' ) }
</SidebarButton>
</>
}
description={ description }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ export default function SidebarNavigationScreen( {
justify="flex-start"
>
<HStack
spacing={ 4 }
alignment="flex-start"
spacing={ 2 }
alignment="center"
className="edit-site-sidebar-navigation-screen__title-icon"
>
{ ! isRoot && (
Expand Down Expand Up @@ -118,9 +118,14 @@ export default function SidebarNavigationScreen( {
) }
</Heading>
{ actions && (
<div className="edit-site-sidebar-navigation-screen__actions">
<HStack
spacing={ 2 }
alignment="center"
justify="end"
className="edit-site-sidebar-navigation-screen__actions"
>
{ actions }
</div>
</HStack>
) }
</HStack>
{ meta && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,11 @@

.edit-site-sidebar-navigation-screen__title {
flex-grow: 1;
padding: $grid-unit-15 * 0.5 0 0 0;
flex-shrink: 0;
overflow: hidden;
overflow-wrap: break-word;
}

.edit-site-sidebar-navigation-screen__actions {
flex-shrink: 0;
}

.edit-site-sidebar-navigation-screen__content .edit-site-global-styles-style-variations-container {
.edit-site-global-styles-variations_item-preview {
border: $gray-900 $border-width solid;
Expand Down
Loading