File tree Expand file tree Collapse file tree 7 files changed +68
-46
lines changed
Expand file tree Collapse file tree 7 files changed +68
-46
lines changed Original file line number Diff line number Diff line change 11import type { Metadata } from "next" ;
22import localFont from "next/font/local" ;
3+ import { Source_Serif_4 } from "next/font/google" ;
4+ import clsx from "clsx" ;
35
6+ import GoogleAnalytics from "@/components/GoogleAnalytics" ;
47import { GOOGLE_ANALYTICS , GOOGLE_VERIFICATION_CODE } from "@/consts/env" ;
58
69import "./globals.css" ;
710import { BASE_URL } from "./const" ;
811import { bodyContainer } from "./layout.css" ;
9- import GoogleAnalytics from "@/components/GoogleAnalytics" ;
1012
1113export const metadata : Metadata = {
1214 title : "SNUPI Blog" ,
@@ -52,13 +54,29 @@ const pretendardFont = localFont({
5254 display : "swap" ,
5355} ) ;
5456
57+ const sourceSerif4Font = Source_Serif_4 ( {
58+ weight : [ '200' , '300' , '400' ] ,
59+ subsets : [ 'latin' , 'latin-ext' ] ,
60+ display : 'swap' ,
61+ variable : '--font-source-serif-4' ,
62+ } ) ;
63+
64+
5565export default function RootLayout ( {
5666 children,
5767} : {
5868 children : React . ReactNode ;
5969} ) {
6070 return (
61- < html lang = "en" className = { `${ pretendardFont . className } ` } >
71+ < html
72+ lang = "en"
73+ className = {
74+ clsx (
75+ pretendardFont . className ,
76+ sourceSerif4Font . variable
77+ )
78+ }
79+ >
6280 {
6381 GOOGLE_ANALYTICS
6482 ? (
Original file line number Diff line number Diff line change 11import { style } from "@vanilla-extract/css" ;
22
33export const largeDisplayHeading = style ( {
4- fontSize : "48px " ,
5- lineHeight : "130 %" ,
6- letterSpacing : "0.1em " ,
4+ fontSize : "52px " ,
5+ lineHeight : "150 %" ,
6+ letterSpacing : "0.15em " ,
77} ) ;
8- export const largeHeadlineHeading = style ( {
9- fontSize : "33px" ,
10- lineHeight : "130%" ,
11- } ) ;
12- export const largeTitleHeading = style ( {
13- fontSize : "23px" ,
14- lineHeight : "130%" ,
15- letterSpacing : "-0.001em" ,
8+ export const mediumDisplayHeading = style ( {
9+ fontSize : "40px" ,
10+ lineHeight : "150%" ,
1611} ) ;
1712export const mediumTitleHeading = style ( {
18- fontSize : "18px " ,
19- lineHeight : "130 %" ,
13+ fontSize : "20px " ,
14+ lineHeight : "150 %" ,
2015} ) ;
2116export const smallTitleHeading = style ( {
17+ fontSize : "18px" ,
18+ lineHeight : "150%" ,
19+ } ) ;
20+ export const extraSmallTitleHeading = style ( {
2221 fontSize : "16px" ,
23- lineHeight : "130 %" ,
22+ lineHeight : "150 %" ,
2423} ) ;
2524
2625export const extraLightWeight = style ( {
@@ -34,4 +33,8 @@ export const mediumWeight = style({
3433} )
3534export const semiBoldWeight = style ( {
3635 fontWeight : '600'
36+ } )
37+
38+ export const serifFont = style ( {
39+ fontFamily : 'var(--font-source-serif-4)'
3740} )
Original file line number Diff line number Diff line change @@ -4,28 +4,30 @@ import clsx from "clsx";
44import {
55 extraLightWeight ,
66 largeDisplayHeading ,
7- largeHeadlineHeading ,
8- largeTitleHeading ,
7+ extraSmallTitleHeading ,
98 lightWeight ,
9+ mediumDisplayHeading ,
1010 mediumTitleHeading ,
1111 mediumWeight ,
1212 semiBoldWeight ,
13+ serifFont ,
1314 smallTitleHeading ,
1415} from "./index.css" ;
1516
1617
1718interface HeadingProps extends Omit < HeadingTagProps , 'className' > {
18- size ?: "display-l" | "headline-l " | "title-l " | "title-m " | "title-s " ;
19+ size ?: "display-l" | "display-m " | "title-m " | "title-s " | "title-xs " ;
1920 weight ?: 'extraLight' | 'light' | 'medium' | 'semiBold' ;
21+ serif ?: boolean ;
2022 className ?: string ;
2123} ;
2224
2325const sizeCss = {
2426 "display-l" : largeDisplayHeading ,
25- "headline-l" : largeHeadlineHeading ,
26- "title-l" : largeTitleHeading ,
27+ "display-m" : mediumDisplayHeading ,
2728 "title-m" : mediumTitleHeading ,
28- "title-s" : smallTitleHeading
29+ "title-s" : smallTitleHeading ,
30+ "title-xs" : extraSmallTitleHeading ,
2931} as const
3032const weightCss = {
3133 "extraLight" : extraLightWeight ,
@@ -37,6 +39,7 @@ const weightCss = {
3739export default function Heading ( {
3840 size = "title-m" ,
3941 weight = 'medium' ,
42+ serif = false ,
4043 className,
4144 ...props
4245} : HeadingProps ) {
@@ -46,6 +49,7 @@ export default function Heading({
4649 clsx (
4750 sizeCss [ size ] ,
4851 weightCss [ weight ] ,
52+ serif && serifFont ,
4953 className
5054 )
5155 }
Original file line number Diff line number Diff line change 11import { style } from "@vanilla-extract/css" ;
22
3- export const extraLargeLabel = style ( {
4- fontSize : "23px" ,
5- lineHeight : "130%" ,
3+ export const largeTabLabel = style ( {
4+ fontSize : "16px" ,
5+ lineHeight : "150%" ,
6+ letterSpacing : "0.05em"
67} ) ;
78export const largeLabel = style ( {
8- fontSize : "18px " ,
9- lineHeight : "130 %" ,
9+ fontSize : "16px " ,
10+ lineHeight : "150 %" ,
1011} ) ;
1112export const mediumLabel = style ( {
1213 fontSize : "14px" ,
13- lineHeight : "130 %" ,
14+ lineHeight : "150 %" ,
1415} ) ;
15- export const smallLabel = style ( {
16- fontSize : "11px" ,
17- lineHeight : "130%" ,
18- } ) ;
16+
17+ export const serifFont = style ( {
18+ fontSize : "var(--font-source-serif-4)"
19+ } )
Original file line number Diff line number Diff line change @@ -2,27 +2,28 @@ import { PropsWithChildren } from "react";
22import clsx from "clsx" ;
33
44import {
5- extraLargeLabel ,
65 largeLabel ,
6+ largeTabLabel ,
77 mediumLabel ,
8- smallLabel ,
8+ serifFont ,
99} from "./index.css" ;
1010
1111
1212interface LabelProps {
13- size ?: "xl" | "l" | "m" | "s" ;
13+ size ?: "tab-l" | "l" | "m" ;
14+ serif ?: boolean ;
1415 className ?: string ;
1516} ;
1617
1718const sizeCss = {
18- "xl " : extraLargeLabel ,
19+ "tab-l " : largeTabLabel ,
1920 "l" : largeLabel ,
2021 "m" : mediumLabel ,
21- "s" : smallLabel
2222} as const
2323
2424export default function Label ( {
2525 size = "m" ,
26+ serif = false ,
2627 className,
2728 children,
2829} : PropsWithChildren < LabelProps > ) {
@@ -31,6 +32,7 @@ export default function Label({
3132 className = {
3233 clsx (
3334 sizeCss [ size ] ,
35+ serif && serifFont ,
3436 className
3537 )
3638 }
Original file line number Diff line number Diff line change 11import { style } from "@vanilla-extract/css" ;
22
3- export const largeText = style ( {
4- fontSize : "18px" ,
5- lineHeight : "150%" ,
6- } ) ;
73export const mediumText = style ( {
84 fontSize : "16px" ,
9- lineHeight : "150 %" ,
5+ lineHeight : "200 %" ,
106} ) ;
117export const smallText = style ( {
128 fontSize : "14px" ,
13- lineHeight : "150 %" ,
9+ lineHeight : "200 %" ,
1410} ) ;
1511
1612export const lightWeight = style ( {
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ import { PropsWithChildren } from "react";
22import clsx from "clsx" ;
33
44import {
5- largeText ,
65 regularWeight ,
76 mediumText ,
87 mediumWeight ,
@@ -12,13 +11,12 @@ import {
1211
1312
1413export interface TextProps {
15- size ?: "l" | " m" | "s" ;
14+ size ?: "m" | "s" ;
1615 weight ?: 'light' | 'regular' | 'medium' ;
1716 className ?: string ;
1817} ;
1918
2019const sizeCss = {
21- "l" : largeText ,
2220 "m" : mediumText ,
2321 "s" : smallText
2422} as const
You can’t perform that action at this time.
0 commit comments