Skip to content

Commit 13be6e1

Browse files
committed
feat: RichText, Typography style 변경
1 parent d3ea2a2 commit 13be6e1

File tree

4 files changed

+45
-20
lines changed

4 files changed

+45
-20
lines changed

packages/notion-to-jsx/src/components/Renderer/components/RichText/RichTexts.tsx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,14 @@ const RichTexts: React.FC<RichTextProps> = ({ richTexts }) => {
5050
) : (
5151
text.text.content
5252
);
53-
54-
const colorValue =
55-
color === 'default'
56-
? 'inherit'
57-
: color?.includes('_background')
58-
? `var(--notion-${color})`
59-
: `var(--notion-${color})`;
53+
54+
// TODO: NOTION COLOR 적용
55+
// const colorValue =
56+
// color === 'default'
57+
// ? 'inherit'
58+
// : color?.includes('_background')
59+
// ? `var(--notion-${color})`
60+
// : `var(--notion-${color})`;
6061

6162
return (
6263
<span
@@ -68,7 +69,7 @@ const RichTexts: React.FC<RichTextProps> = ({ richTexts }) => {
6869
underline,
6970
code,
7071
})}
71-
style={{ color: colorValue }}
72+
// style={{ color: colorValue }}
7273
>
7374
{content}
7475
</span>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ export const richText = recipe({
3333
background: vars.colors.code.background,
3434
padding: '0.2em 0.4em',
3535
borderRadius: vars.borderRadius.sm,
36+
fontWeight: vars.typography.fontWeight.medium,
3637
fontFamily: vars.typography.fontFamily.code,
3738
fontSize: '0.85em',
39+
color: vars.colors.code.inline,
3840
},
3941
},
4042
},

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

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ const baseTypography = {
66
color: vars.colors.text,
77
fontFamily: vars.typography.fontFamily.base,
88
lineHeight: vars.typography.lineHeight.base,
9-
':hover': {
10-
backgroundColor: vars.colors.background,
11-
opacity: 0.8,
12-
},
139
selectors: {
1410
'&:focus-visible': {
1511
outline: `2px solid ${vars.colors.primary}`,
@@ -21,27 +17,29 @@ const baseTypography = {
2117

2218
export const paragraph = style({
2319
...baseTypography,
24-
margin: `${vars.spacing.sm} 0`,
20+
padding: `${vars.spacing.xs} ${vars.spacing.xxs}`,
2521
fontSize: vars.typography.fontSize.base,
22+
fontWeight: vars.typography.fontWeight.medium,
23+
whiteSpace: 'pre-wrap', // 줄바꿈
2624
});
2725

2826
export const heading1 = style({
2927
...baseTypography,
3028
fontSize: vars.typography.fontSize.h1,
31-
// fontWeight: vars.typography.fontWeight.bold,
29+
fontWeight: vars.typography.fontWeight.bold,
3230
margin: `${vars.spacing.lg} 0 ${vars.spacing.md}`,
3331
});
3432

3533
export const heading2 = style({
3634
...baseTypography,
3735
fontSize: vars.typography.fontSize.h2,
38-
// fontWeight: vars.typography.fontWeight.semibold,
36+
fontWeight: vars.typography.fontWeight.bold,
3937
margin: `${vars.spacing.md} 0 ${vars.spacing.sm}`,
4038
});
4139

4240
export const heading3 = style({
4341
...baseTypography,
4442
fontSize: vars.typography.fontSize.h3,
45-
// fontWeight: vars.typography.fontWeight.medium,
43+
fontWeight: vars.typography.fontWeight.bold,
4644
margin: `${vars.spacing.sm} 0 ${vars.spacing.xs}`,
4745
});

packages/notion-to-jsx/src/styles/theme.css.ts

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export const vars = createThemeContract({
1010
code: {
1111
background: null,
1212
text: null,
13+
inline: null,
1314
},
1415
},
1516
typography: {
@@ -25,13 +26,20 @@ export const vars = createThemeContract({
2526
h2: null,
2627
h3: null,
2728
},
29+
fontWeight: {
30+
normal: null,
31+
medium: null,
32+
semibold: null,
33+
bold: null,
34+
},
2835
lineHeight: {
2936
tight: null,
3037
base: null,
3138
relaxed: null,
3239
},
3340
},
3441
spacing: {
42+
xxs: null,
3543
xs: null,
3644
sm: null,
3745
md: null,
@@ -53,18 +61,19 @@ export const vars = createThemeContract({
5361
export const lightTheme = createTheme(vars, {
5462
colors: {
5563
background: '#ffffff',
56-
text: '#24292e',
64+
text: '#37352f',
5765
primary: '#0366d6',
5866
secondary: '#586069',
5967
border: '#e1e4e8',
6068
code: {
61-
background: '#f6f8fa',
69+
background: 'rgba(135,131,120,.1)',
6270
text: '#24292e',
71+
inline: '#EB5757',
6372
},
6473
},
6574
typography: {
6675
fontFamily: {
67-
base: '-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif',
76+
base: 'ui-sans-serif -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif',
6877
code: 'SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace',
6978
},
7079
fontSize: {
@@ -75,13 +84,20 @@ export const lightTheme = createTheme(vars, {
7584
h2: '1.5rem',
7685
h3: '1.25rem',
7786
},
87+
fontWeight: {
88+
normal: '400',
89+
medium: '500',
90+
semibold: '600',
91+
bold: '700',
92+
},
7893
lineHeight: {
7994
tight: '1.25',
8095
base: '1.5',
8196
relaxed: '1.75',
8297
},
8398
},
8499
spacing: {
100+
xxs: '0.125rem',
85101
xs: '0.25rem',
86102
sm: '0.5rem',
87103
md: '1rem',
@@ -110,11 +126,12 @@ export const darkTheme = createTheme(vars, {
110126
code: {
111127
background: '#161b22',
112128
text: '#c9d1d9',
129+
inline: '#EB5757',
113130
},
114131
},
115132
typography: {
116133
fontFamily: {
117-
base: '-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif',
134+
base: 'ui-sans-serif -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif',
118135
code: 'SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace',
119136
},
120137
fontSize: {
@@ -125,13 +142,20 @@ export const darkTheme = createTheme(vars, {
125142
h2: '1.5rem',
126143
h3: '1.25rem',
127144
},
145+
fontWeight: {
146+
normal: '400',
147+
medium: '500',
148+
semibold: '600',
149+
bold: '700',
150+
},
128151
lineHeight: {
129152
tight: '1.25',
130153
base: '1.5',
131154
relaxed: '1.75',
132155
},
133156
},
134157
spacing: {
158+
xxs: '0.125rem',
135159
xs: '0.25rem',
136160
sm: '0.5rem',
137161
md: '1rem',

0 commit comments

Comments
 (0)