Skip to content

Commit

Permalink
Remove .components-item-group selector in edit-site components[2] (#6…
Browse files Browse the repository at this point in the history
…7575)

* fix: Removed .components-item-group selector class usage in scss file in edit-site components

Applied horizontal margins to the following screens
1. Navigation
2. Pages
3. Templates
4. Patterns

* fix: Added sidebar-navigation-screen-main/style.scss file correctly

* refactor: CSS code for sidebar in editor

Co-authored-by: im3dabasia <[email protected]>
Co-authored-by: t-hamano <[email protected]>
Co-authored-by: afercia <[email protected]>
  • Loading branch information
4 people authored Dec 8, 2024
1 parent df98e37 commit 7cf1ced
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function DataViewsSidebarContent( { postType } ) {

return (
<>
<ItemGroup>
<ItemGroup className="edit-site-sidebar-dataviews">
{ defaultViews.map( ( dataview ) => {
return (
<DataViewItem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
}
}

.edit-site-sidebar-dataviews {
margin-left: -$grid-unit-20;
margin-right: -$grid-unit-20;
}

.edit-site-sidebar-dataviews-dataview-item {
border-radius: $radius-small;
padding-right: $grid-unit-10;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { store as editSiteStore } from '../../store';

export function MainSidebarNavigationContent() {
return (
<ItemGroup>
<ItemGroup className="edit-site-sidebar-navigation-screen-main">
<SidebarNavigationItem
uid="navigation-navigation-item"
to="/navigation"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.edit-site-sidebar-navigation-screen-main {
margin-left: -$grid-unit-20;
margin-right: -$grid-unit-20;
}
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export default function SidebarNavigationScreenNavigationMenus( { backPath } ) {

return (
<SidebarNavigationScreenWrapper backPath={ backPath }>
<ItemGroup>
<ItemGroup className="edit-site-sidebar-navigation-screen-navigation-menus">
{ navigationMenus?.map( ( { id, title, status }, index ) => (
<NavMenuItem
postId={ id }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
margin: 0 0 $grid-unit-40 0;
}

.edit-site-sidebar-navigation-screen-navigation-menus {
margin-left: -$grid-unit-20;
margin-right: -$grid-unit-20;
}

.edit-site-sidebar-navigation-screen-navigation-menus__content {
.block-editor-list-view-leaf .block-editor-list-view-block__contents-cell {
width: 100%;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
.edit-site-sidebar-navigation-screen-patterns__group {
margin-bottom: $grid-unit-30;
margin-left: -$grid-unit-20;
margin-right: -$grid-unit-20;

&:last-of-type {
border-bottom: 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default function DataviewsTemplatesSidebarContent() {
}, [ records ] );

return (
<ItemGroup>
<ItemGroup className="edit-site-sidebar-navigation-screen-templates-browse">
<SidebarNavigationItem
to="/template"
icon={ layout }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.edit-site-sidebar-navigation-screen-templates-browse {
margin-left: -$grid-unit-20;
margin-right: -$grid-unit-20;
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@
.edit-site-sidebar-navigation-screen__content {
padding: 0 $grid-unit-20;

.components-item-group {
margin-left: -$grid-unit-20;
margin-right: -$grid-unit-20;
}

.components-text {
color: $gray-400;
}
Expand Down
4 changes: 3 additions & 1 deletion packages/edit-site/src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@
@import "./components/sidebar-navigation-screen-details-footer/style.scss";
@import "./components/sidebar-navigation-screen-navigation-menu/style.scss";
@import "./components/sidebar-navigation-screen-patterns/style.scss";
@import "./components/sidebar-navigation-screen-navigation-menus/style.scss";
@import "./components/sidebar-navigation-screen-main/style.scss";
@import "./components/sidebar-navigation-screen-templates-browse/style.scss";
@import "./components/sidebar-dataviews/style.scss";
@import "./components/site-hub/style.scss";
@import "./components/sidebar-navigation-screen-navigation-menus/style.scss";
@import "./components/site-icon/style.scss";
@import "./components/style-book/style.scss";
@import "./components/editor-canvas-container/style.scss";
Expand Down

1 comment on commit 7cf1ced

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 7cf1ced.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12218007220
📝 Reported issues:

Please sign in to comment.