Skip to content

Commit be54c6e

Browse files
committed
feat: improve responsive design for cover and bookmark components
1 parent 2b43374 commit be54c6e

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<!-- .storybook/preview-head.html -->
22
<style>
33
/* 스토리북 루트 요소에 적용될 스타일 */
4-
#storybook-root, #storybook-docs, .docs-story, .sb-main-padded, .sb-main, .docs-story .simplebar-content {
4+
#storybook-root {
55
width: 100% !important;
66
max-width: 100% !important;
77
box-sizing: border-box !important;
8+
padding: 0 !important;
89
}
10+
911
</style>

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,10 @@ export const cover = style({
99
objectPosition: 'center 50%',
1010
borderRadius: '1.5rem',
1111
margin: '0 auto',
12+
'@media': {
13+
'(max-width: 900px)': {
14+
borderRadius: '0.5rem',
15+
height: '25vh',
16+
},
17+
},
1218
});

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-
<div className={urlText}>{ogData?.url || ''}</div>
104+
<span className={urlText}>{ogData?.url || ''}</span>
105105
</div>
106106
</div>
107107
{ogData?.image && (

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,7 @@ export const title = style({
6060
minHeight: '1.5rem',
6161
overflow: 'hidden',
6262
textOverflow: 'ellipsis',
63-
display: '-webkit-box',
64-
WebkitLineClamp: 1,
65-
WebkitBoxOrient: 'vertical',
63+
whiteSpace: 'nowrap',
6664
});
6765

6866
export const description = style({
@@ -100,6 +98,4 @@ export const urlText = style({
10098
whiteSpace: 'nowrap',
10199
textOverflow: 'ellipsis',
102100
maxWidth: '100%',
103-
width: '1px',
104-
flexGrow: 1,
105101
});

0 commit comments

Comments
 (0)