Skip to content

Commit

Permalink
Adding ellipsis props to Card component (#3858)
Browse files Browse the repository at this point in the history
* Adding `ellipsis` props to Card component

* lint&format

* lint

* prettier

* upd

---------

Co-authored-by: Dimitri POSTOLOV <[email protected]>
  • Loading branch information
jellli and dimaMachina authored Dec 24, 2024
1 parent f62827b commit bfa61d9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .changeset/lucky-queens-burn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'nextra': patch
'nextra-theme-blog': patch
'nextra-theme-docs': patch
---

add `text-overflow: ellipsis` for `<Cards.Card>` component
3 changes: 2 additions & 1 deletion packages/nextra/src/client/components/cards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ function Card({
? 'dark:_text-gray-300 dark:hover:_text-gray-100'
: 'dark:_text-neutral-200 dark:hover:_text-neutral-50'
)}
title={title}
>
{icon}
{title}
<span className="_truncate">{title}</span>
</span>
</NextLink>
)
Expand Down
4 changes: 2 additions & 2 deletions packages/nextra/styles/cards.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
}

svg {
@apply _w-6 _h-auto _transition _text-black/30 dark:_text-white/40;
@apply _w-6 _h-auto _transition _text-black/30 dark:_text-white/40 _shrink-0;
}

&:hover svg {
@apply _text-current dark:_text-current;
@apply !_text-current;
}

p {
Expand Down

0 comments on commit bfa61d9

Please sign in to comment.