Skip to content

Commit

Permalink
Style labels in search results
Browse files Browse the repository at this point in the history
  • Loading branch information
kreafox committed Mar 10, 2023
1 parent cdb843a commit 04c6e27
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
6 changes: 4 additions & 2 deletions searchlib/components/Result/HorizontalCardItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,11 @@ const HorizontalCardItem = (props) => {
<>
<ExternalLink href={result.href} title={result.title}>
{result.title}
{result.isNew && <Label className="new-item">New</Label>}
{result.isExpired && (
<Label className="archived-item">Archived</Label>
)}
</ExternalLink>
{result.isNew && <Label className="new-item">New</Label>}
{result.isExpired && <Label className="archived-item">Archived</Label>}
</>
),
meta: <ContentClusters clusters={clusters} item={result} />,
Expand Down
22 changes: 22 additions & 0 deletions src/SearchBlock/less/searchresult.less
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,28 @@
}
}

.listing-item a,
.listing-header a {
display: inline-block;

.ui.label.new-item,
.ui.label.archived-item {
display: inline-block;
padding: 0.2em 0.6em 0.3em;
margin-top: -2px;
margin-left: 0.7em !important;
background-color: #d3d3d3;
border-radius: 0.25em;
color: #434343;
font-size: 13px;
font-weight: normal;
line-height: 1;
text-align: center;
vertical-align: middle;
white-space: nowrap;
}
}

.slot-bottom {
margin-top: auto;
}
Expand Down

0 comments on commit 04c6e27

Please sign in to comment.