Skip to content

Commit

Permalink
feat: enhance responsive design on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
kuizuo committed Jan 13, 2024
1 parent b7b36ba commit b0963c8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions src/css/custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -327,3 +327,9 @@ div[class^='announcementBar_'] {
width: 100%;
}
}

.truncate {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
8 changes: 4 additions & 4 deletions src/theme/BlogPostItem/Header/Info/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ function useReadingTimePlural() {

export function ReadingTime({ readingTime }: { readingTime: number }) {
const readingTimePlural = useReadingTimePlural()
return <>{readingTimePlural(readingTime)}</>
return <span className="truncate">{readingTimePlural(readingTime)}</span>
}

function Date({ date, formattedDate }: { date: string; formattedDate: string }) {
return (
<time dateTime={date} itemProp="datePublished">
<time dateTime={date} itemProp="datePublished" className="truncate">
{formattedDate}
</time>
)
Expand All @@ -58,8 +58,8 @@ export default function BlogPostItemHeaderInfo({ className }: Props): JSX.Elemen
{tagsExists && (
<div className={styles.tagInfo}>
<Icon icon="ri:price-tag-3-line" />
<div className={styles.tagList}>
{tags.slice(0, 2).map(({ label, permalink: tagPermalink }, index) => {
<div className={clsx('truncate', styles.tagList)}>
{tags.slice(0, 3).map(({ label, permalink: tagPermalink }, index) => {
return (
<div key={tagPermalink}>
{index !== 0 && '/'}
Expand Down

0 comments on commit b0963c8

Please sign in to comment.