Skip to content

Commit

Permalink
Dashboard: Scan card layout looks bad when threats are found (#15052)
Browse files Browse the repository at this point in the history
Minor styling adjustment for the "Security -> Scan" dashboard widget.
The problem only appears if there are threats found.
More information and steps on how to reproduce: #14914
  • Loading branch information
sergeymitr authored Mar 20, 2020
1 parent d9e6a4c commit 9dc02e1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion _inc/client/at-a-glance/scan.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class DashScan extends Component {
if ( threats !== 0 ) {
return renderCard( {
content: [
<h3>
<h3 className="jp-dash-item__title jp-dash-item__title_fullwidth jp-dash-item__title_top">
{ __( 'Uh oh, %(number)s threat found.', 'Uh oh, %(number)s threats found.', {
count: threats,
args: { number: numberFormat( threats ) },
Expand Down
14 changes: 13 additions & 1 deletion _inc/client/components/dash-item/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
display: inline-block;
border: 1px solid $light-gray-700;
border-radius: 4px;
padding: 0px 4px;
padding: 0 4px;
min-width: 36px;
text-align: center;

Expand All @@ -50,6 +50,18 @@
}
}

.jp-dash-item__title {
max-width: calc( 100% - 18px ); // For the support icon

&.jp-dash-item__title_fullwidth {
flex-basis: 100%;
}

&.jp-dash-item__title_top {
margin-top: 0;
}
}

.jp-dash-item__description {
margin: 0;
font-size: rem( 14px );
Expand Down

0 comments on commit 9dc02e1

Please sign in to comment.