+ Section +
++ 오래 머무는 자리 +
++ 제목은 {template.fontStyle}, 본문은 이 서체로 나갑니다. +
+ +{template.description} diff --git a/solution/frontend/src/index.css b/solution/frontend/src/index.css index c644c6d..92c927d 100644 --- a/solution/frontend/src/index.css +++ b/solution/frontend/src/index.css @@ -60,8 +60,19 @@ body { ★ 폴백이 inherit 이라 --tpl-font-heading 이 없으면 예전과 똑같이 본문 서체를 그대로 물려받는다. */ .site-canvas h1, .site-canvas h2, - .site-canvas h3 { + .site-canvas h3, + .site-canvas h4 { font-family: var(--tpl-font-heading, inherit); + letter-spacing: var(--tpl-heading-tracking, normal); + } + /* ★ 굵기는 폴백을 inherit 로 두지 않는다. 간판체(Gugi)는 굵기가 한 벌뿐이라 700 을 주면 + 브라우저가 가짜 볼드를 씌워 획이 뭉갠다 — 템플릿이 400 을 지정할 수 있어야 한다. */ + .site-canvas :is(h1, h2, h3, h4).tpl-title { + font-weight: var(--tpl-heading-weight, 700); + } + /* 카드·패널 테두리 두께도 템플릿이 정한다. 레트로는 2px 라야 인쇄물처럼 보인다. */ + .site-canvas .border { + border-width: var(--tpl-border-width, 1px); } } diff --git a/solution/shared/src/types/builder.ts b/solution/shared/src/types/builder.ts index 1f4487c..8899131 100644 --- a/solution/shared/src/types/builder.ts +++ b/solution/shared/src/types/builder.ts @@ -67,7 +67,15 @@ export interface TemplateItem { text: string; accent: string; }; + /** 사람에게 보이는 서체 이름('고딕' · '명조 제목'). 실제 서체는 look 이 정한다. */ fontStyle: string; + /** + * 실제로 화면을 가르는 값. + * + * ★ 예전엔 색 여섯 개뿐이라 템플릿을 바꿔도 색조만 달라졌다 — 다섯 개가 다 같아 보였다. + * 서체·모서리·테두리·그림자·여백이 여기 있고, 캔버스가 CSS 변수로 그대로 내려보낸다. + */ + look: TemplateLook; /** * 이 템플릿을 고르면 함께 들어오는 섹션(canvas/addable 의 타입). * @@ -77,6 +85,29 @@ export interface TemplateItem { defaultSectionTypes?: string[]; } +/** + * 템플릿의 생김새. 값은 전부 CSS 에 그대로 들어가는 문자열이다 — + * 숫자로 들고 있다가 쓰는 쪽에서 단위를 붙이면, 빠뜨린 곳이 조용히 0 이 된다. + */ +export interface TemplateLook { + /** 제목 서체 스택. `--tpl-font-heading` */ + fontHeading: string; + /** 본문 서체 스택. `--tpl-font-body` */ + fontBody: string; + /** 모서리. Tailwind 의 `--radius-*` 를 캔버스 안에서만 덮어 rounded-* 전부가 따라온다. */ + radius: string; + /** 카드·패널 테두리 두께. */ + borderWidth: string; + /** 카드 그림자. Tailwind 의 `--shadow-*` 를 덮는다. 'none' 이면 평평해진다. */ + shadow: string; + /** 제목 자간. */ + headingTracking: string; + /** 제목 굵기. 간판체처럼 한 굵기뿐인 서체는 400 이어야 한다. */ + headingWeight: string; + /** 섹션 세로 여백. 이 값 하나로 페이지의 호흡이 바뀐다. */ + sectionSpace: string; +} + export interface PhotoItem { id: string; url: string;