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

Update the global styles sidebar's root view to use Card components #35547

Merged
merged 1 commit into from
Oct 12, 2021
Merged
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
43 changes: 27 additions & 16 deletions packages/edit-site/src/components/global-styles/screen-root.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
import {
__experimentalItemGroup as ItemGroup,
__experimentalItem as Item,
CardBody,
Card,
CardDivider,
} from '@wordpress/components';
import { __ } from '@wordpress/i18n';

Expand All @@ -16,24 +19,32 @@ import ContextMenu from './context-menu';

function ScreenRoot() {
return (
<>
<StylesPreview />
<Card size="small">
Copy link
Contributor Author

Choose a reason for hiding this comment

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

To match the spacing in the sidebar header, I had to put "small" as a size for the Card. I wonder if this should be the default (and potentially the only choice).

Copy link
Member

Choose a reason for hiding this comment

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

Possibly, not sure where else we are using it.

<CardBody>
<StylesPreview />
</CardBody>

<ContextMenu />
<CardBody>
<ContextMenu />
</CardBody>

<ItemGroup>
<Item>
<p>
{ __(
'Customize the appearance of specific blocks for the whole site.'
) }
</p>
</Item>
<NavigationButton path="/blocks">
{ __( 'Blocks' ) }
</NavigationButton>
</ItemGroup>
</>
<CardDivider />

<CardBody>
<ItemGroup>
<Item>
<p>
{ __(
'Customize the appearance of specific blocks for the whole site.'
) }
</p>
</Item>
<NavigationButton path="/blocks">
{ __( 'Blocks' ) }
</NavigationButton>
</ItemGroup>
</CardBody>
</Card>
);
}

Expand Down
1 change: 0 additions & 1 deletion packages/edit-site/src/components/global-styles/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
align-items: center;
justify-content: center;
min-height: 152px;
margin: $grid-unit-20;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's cool that there's no need for custom spacing like that.

line-height: 1;

.component-color-indicator {
Expand Down