Skip to content

Commit

Permalink
change: add style for tab icons
Browse files Browse the repository at this point in the history
  • Loading branch information
kreafox committed Jan 30, 2024
1 parent 9e51a5b commit 90ccda7
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 3 deletions.
14 changes: 11 additions & 3 deletions searchlib/components/Facets/Connected/SectionTabs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,17 @@ const SectionTabs = (props) => {
}
}}
>
{showIcons && <Icon type={value} family="Content types" />}
<span className="title">{value}&nbsp;</span>
<span className="count">({count})</span>
{showIcons ? (
<div className="tab-icon" title={value}>
<Icon className="small" type={value} family="Content types" />
<span className="count">{count}</span>
</div>
) : (
<>
<span className="title">{value}&nbsp;</span>
<span className="count">({count})</span>
</>
)}
</Menu.Item>
))}
</Menu>
Expand Down
34 changes: 34 additions & 0 deletions src/SearchBlock/less/searchview.less
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,40 @@ body.searchlib-page {
&::-webkit-scrollbar {
height: 0.3rem !important;
}

.active.item {
.tab-icon {
.count {
border: none;
color: @white;
background-color: @primaryColor;
border: 2px solid @primaryColor;
}
}
}

.tab-icon {
position: relative;
}

.tab-icon .count {
font-size: 10px;
font-weight: bold;
border-radius: 50%;
height: 26px;
width: 26px;
line-height: 23px;
background-color: @white;
color: #3d5265; // TODO: replace with @blue-grey-5 from volto-design-tokens
border: 2px solid #3d5265;
top: auto;
bottom: -0.6em;
text-align: center;
position: absolute;
z-index: 100;
left: 100%;
margin-left: -1.5em;
}
}

.sorting {
Expand Down

0 comments on commit 90ccda7

Please sign in to comment.