Skip to content

Commit cd8b70b

Browse files
committed
feat: Bookmark responsive add
1 parent 954ae98 commit cd8b70b

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

packages/notion-to-jsx/src/components/Renderer/components/Bookmark/Bookmark.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ const Bookmark: React.FC<BookmarkProps> = ({ url }) => {
101101
{ogData?.favicon && (
102102
<img src={ogData.favicon} alt="" className={favicon} />
103103
)}
104-
<span className={urlText}>{ogData?.url || ''}</span>
104+
<div className={urlText}>{ogData?.url || ''}</div>
105105
</div>
106106
</div>
107107
{ogData?.image && (

packages/notion-to-jsx/src/components/Renderer/components/Bookmark/styles.css.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ export const previewContainer = style({
3636
justifyContent: 'center',
3737
maxHeight: '8rem',
3838
overflow: 'hidden',
39+
'@media': {
40+
'(max-width: 420px)': {
41+
display: 'none',
42+
},
43+
},
3944
});
4045

4146
export const previewImage = style({
@@ -55,7 +60,9 @@ export const title = style({
5560
minHeight: '1.5rem',
5661
overflow: 'hidden',
5762
textOverflow: 'ellipsis',
58-
whiteSpace: 'nowrap',
63+
display: '-webkit-box',
64+
WebkitLineClamp: 1,
65+
WebkitBoxOrient: 'vertical',
5966
});
6067

6168
export const description = style({
@@ -93,4 +100,6 @@ export const urlText = style({
93100
whiteSpace: 'nowrap',
94101
textOverflow: 'ellipsis',
95102
maxWidth: '100%',
103+
width: '1px',
104+
flexGrow: 1,
96105
});

0 commit comments

Comments
 (0)