Skip to content

Commit

Permalink
Update some visual details in the add-template modal(s) (#50143)
Browse files Browse the repository at this point in the history
  • Loading branch information
jameskoster authored May 3, 2023
1 parent 8066e00 commit aa9f5f4
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,25 @@ function SuggestionListItem( {
)
}
>
<span className={ `${ baseCssClass }__title` }>
<Text
size="body"
lineHeight={ 1.53846153846 } // 20px
weight={ 500 }
className={ `${ baseCssClass }__title` }
>
<TextHighlight
text={ decodeEntities( suggestion.name ) }
highlight={ search }
/>
</span>
</Text>
{ suggestion.link && (
<span className={ `${ baseCssClass }__info` }>
<Text
size="body"
lineHeight={ 1.53846153846 } // 20px
className={ `${ baseCssClass }__info` }
>
{ suggestion.link }
</span>
</Text>
) }
</CompositeItem>
);
Expand Down Expand Up @@ -221,10 +230,17 @@ function AddCustomTemplateModal( {
} );
} }
>
<Text as="span" weight={ 600 }>
<Text
as="span"
weight={ 500 }
lineHeight={ 1.53846153846 } // 20px
>
{ entityForSuggestions.labels.all_items }
</Text>
<Text as="span">
<Text
as="span"
lineHeight={ 1.53846153846 } // 20px
>
{
// translators: The user is given the choice to set up a template for all items of a post type or taxonomy, or just a specific one.
__( 'For all items' )
Expand All @@ -238,10 +254,17 @@ function AddCustomTemplateModal( {
setShowSearchEntities( true );
} }
>
<Text as="span" weight={ 600 }>
<Text
as="span"
weight={ 500 }
lineHeight={ 1.53846153846 } // 20px
>
{ entityForSuggestions.labels.singular_name }
</Text>
<Text as="span">
<Text
as="span"
lineHeight={ 1.53846153846 } // 20px
>
{
// translators: The user is given the choice to set up a template for all items of a post type or taxonomy, or just a specific one.
__( 'For a specific item' )
Expand Down
100 changes: 52 additions & 48 deletions packages/edit-site/src/components/add-new-template/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,20 @@
}

.edit-site-custom-template-modal {
&__suggestions_list {
margin-left: - $grid-unit-15;
margin-right: - $grid-unit-15;
}

&__contents {
> .components-button {
padding: $grid-unit-30;
box-shadow: inset 0 0 0 $border-width $gray-600;
border-radius: $radius-block-ui;
width: 256px;
height: auto;
display: flex;
flex-direction: column;
gap: $grid-unit;
justify-content: center;
border: $border-width solid $gray-300;

// Show the boundary of the button, in High Contrast Mode.
outline: 1px solid transparent;
Expand All @@ -42,15 +46,17 @@

&:hover {
color: var(--wp-admin-theme-color-darker-10);
box-shadow: inset 0 0 0 $border-width var(--wp-admin-theme-color-darker-10);
background: rgba(var(--wp-admin-theme-color--rgb), 0.04);
border-color: transparent;

span:first-child {
span {
color: var(--wp-admin-theme-color);
}
}

&:focus {
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
border-color: transparent;

// Windows High Contrast mode will show this outline, but not the box-shadow.
outline: 3px solid transparent;
Expand All @@ -77,60 +83,58 @@
@include break-medium() {
width: 456px;
}
}

.edit-site-custom-template-modal__suggestions_list {
@include break-small() {
height: 232px;
overflow: scroll;
}

&__list-item {
display: block;
width: 100%;
text-align: left;
white-space: pre-wrap;
overflow-wrap: break-word;
height: auto;

mark {
font-weight: 700;
background: none;
.edit-site-custom-template-modal__suggestions_list {
@include break-small() {
height: 232px;
overflow: scroll;
}

&:hover {
background-color: $gray-100;
&__list-item {
display: block;
width: 100%;
text-align: left;
white-space: pre-wrap;
overflow-wrap: break-word;
height: auto;
padding: $grid-unit-10 $grid-unit-15;

mark {
color: var(--wp-admin-theme-color);
font-weight: 700;
background: none;
}
}

&:focus {
background-color: $gray-100;
}
&:hover {
background: rgba(var(--wp-admin-theme-color--rgb), 0.04);

&:focus:not(:disabled) {
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color) inset;
}
* {
color: var(--wp-admin-theme-color);
}

&__title,
&__info {
overflow: hidden;
text-overflow: ellipsis;
display: block;
}
mark {
color: var(--wp-admin-theme-color);
}
}

&__title {
font-weight: 500;
margin-bottom: 0.2em;
}
&:focus {
background-color: $gray-100;
}

&:focus:not(:disabled) {
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color) inset;
}

&__info {
color: $gray-700;
font-size: 0.9em;
line-height: 1.3;
word-break: break-all;
&__title,
&__info {
overflow: hidden;
text-overflow: ellipsis;
display: block;
}

&__info {
word-break: break-all;
color: $gray-700;
}
}
}
}
Expand Down

1 comment on commit aa9f5f4

@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 aa9f5f4.
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/4871494523
📝 Reported issues:

Please sign in to comment.