Skip to content

Commit 6a44981

Browse files
committed
Add description to snippetlist and limit title & desc to 1 line
1 parent b91a02f commit 6a44981

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

.github/ISSUE_TEMPLATE/ADD-LANGUAGE.yml

Whitespace-only changes.

src/components/SnippetList.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ const SnippetList = ({ query }: { query?: string | null }) => {
4545
<img src={language.icon} alt={language.lang} />
4646
</div>
4747
<h3 className="snippet__title">{snippet.title}</h3>
48-
{query && (
49-
<p className="snippet__description">{snippet.description}</p>
50-
)}
48+
<p className="snippet__description">{snippet.description}</p>
5149
</button>
5250
</li>
5351
))}

src/styles/main.css

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,21 @@ abbr {
528528

529529
.snippet__title {
530530
color: var(--text-primary);
531+
display: -webkit-box;
532+
-webkit-box-orient: vertical;
533+
-webkit-line-clamp: 1;
534+
line-clamp: 1;
535+
overflow: hidden;
536+
text-overflow: "…";
537+
}
538+
539+
.snippet__description {
540+
display: -webkit-box;
541+
-webkit-box-orient: vertical;
542+
-webkit-line-clamp: 1;
543+
line-clamp: 1;
544+
overflow: hidden;
545+
text-overflow: "…";
531546
}
532547

533548
/*------------------------------------*\

0 commit comments

Comments
 (0)