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 some visual details in the add-template modal(s) #50143

Merged
merged 6 commits into from
May 3, 2023
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
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