Skip to content

Commit

Permalink
refactor(component): refactor PostCard component’s css (#285)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kohei Asai authored Mar 28, 2021
1 parent 4c6f702 commit 130b4c8
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions components/post-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,17 @@ export const PostCard: React.VFC<PostCardProps> = ({
<h1
className={cx(
css`
display: -webkit-box;
margin-block-start: 0;
margin-block-end: 0;
line-height: 1.5;
color: var(--color-fg-strong);
font-size: var(--font-size-md);
font-weight: bold;
line-height: 1.5;
${someCss(2)}
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
${RAINBOW_ANCHOR_CSS}
`,
titleRefCss
Expand Down Expand Up @@ -126,12 +129,3 @@ export const PostCard: React.VFC<PostCardProps> = ({
const imageRefCss = css``;

const titleRefCss = css``;

function someCss(lines: number) {
return `
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: ${lines};
overflow: hidden;
`;
}

1 comment on commit 130b4c8

@vercel
Copy link

@vercel vercel bot commented on 130b4c8 Mar 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.