h2 '라틴 기준으로 만든 도구는 한글에서 멈춘다' 는 무엇이 어떻게 멈추는지
말하지 않았다. 그리고 데모가 그 주장을 증명하지 못했다.
데모가 실제로 실패하고 있었다
word-break: break-all 과 keep-all 을 나란히 두고 '차이는 한 줄뿐'이라고
적었는데, 재보니 줄 수 3 · 높이 87px 로 완전히 동일했다.
어절이 짧아 두 쪽이 같은 자리에서 끊긴 것이다. 차이가 0 인 비교는
증명이 아니라 주장의 반증이다.
개편
h2 -> '라틴 기본값은 한글에서 세 군데가 깨진다'
수치가 데모 개수와 정확히 대응한다
데모 -> 셋으로. 각각 실제로 갈린다
줄바꿈 break-all vs keep-all (긴 어절 + 15rem 고정폭)
행간 1.45 vs 1.75 (높이 74 vs 89)
크기 11px vs 15px (2줄 vs 3줄)
노트도 고쳤다. '로스팅프로파일이 갈린다'고 썼는데 실제로 갈린 건 다른
어절이었다 — 폭에 따라 바뀌므로 어절을 지목하지 않고 현상만 말한다.
스킬 antipatterns.md
'데모가 주장을 증명하는지 재라' 추가.
비교 데모의 높이·줄 수를 실제로 재는 코드와, 차이가 안 날 때의 대처.
This commit is contained in:
parent
61fb0cdcfa
commit
31c0690d4b
3 changed files with 175 additions and 52 deletions
|
|
@ -13,18 +13,34 @@ const { c } = Astro.props;
|
|||
<p class="eyebrow reveal">{c.eyebrow}</p>
|
||||
<h2 id="type-h" class="reveal">{c.h2}</h2>
|
||||
<p class="lead type-lead reveal">{c.lead}</p>
|
||||
<p class="type-body reveal">{c.body}</p>
|
||||
|
||||
{/* 주장을 글로 하지 않고 실물로 보여준다. 두 문단의 차이는 word-break 한 줄뿐이다 */}
|
||||
<div class="demo reveal">
|
||||
<div class="demo-col"><div class="demo-inner">
|
||||
<p class="demo-label muted mono">{c.demoLabels[0]}</p>
|
||||
<p lang="ko" class="demo-text demo-default">{c.demoText}</p>
|
||||
</div></div>
|
||||
<div class="demo-col"><div class="demo-inner">
|
||||
<p class="demo-label muted mono">{c.demoLabels[1]}</p>
|
||||
<p lang="ko" class="demo-text demo-keepall">{c.demoText}</p>
|
||||
</div></div>
|
||||
{/*
|
||||
주장을 글로 하지 않고 실물로 보여준다.
|
||||
|
||||
한때 word-break 하나만 두 칼럼으로 비교했는데, 어절이 짧아 두 쪽이
|
||||
같은 자리에서 끊겼다 — 줄 수도 높이도 똑같았다. 차이가 0 인 비교는
|
||||
증명이 아니라 주장의 반증이다. 셋으로 늘리고, 잘리는 긴 어절을 넣고,
|
||||
폭을 좁혀 실제로 갈리게 만들었다.
|
||||
*/}
|
||||
<div class="full demos reveal">
|
||||
{
|
||||
c.demos.map((d) => (
|
||||
<section class="demo" aria-label={d.title}>
|
||||
<h3 class="demo-title">{d.title}</h3>
|
||||
<div class="demo-pair">
|
||||
<div class="demo-side">
|
||||
<p class="demo-tag mono is-bad">{d.badLabel}</p>
|
||||
<p lang="ko" class:list={["demo-text", `bad-${d.id}`]}>{c.sample}</p>
|
||||
</div>
|
||||
<div class="demo-side">
|
||||
<p class="demo-tag mono is-good">{d.goodLabel}</p>
|
||||
<p lang="ko" class:list={["demo-text", `good-${d.id}`]}>{c.sample}</p>
|
||||
</div>
|
||||
</div>
|
||||
<p class="demo-note muted">{d.note}</p>
|
||||
</section>
|
||||
))
|
||||
}
|
||||
</div>
|
||||
|
||||
<ul class="type-rules reveal">
|
||||
|
|
@ -33,41 +49,81 @@ const { c } = Astro.props;
|
|||
</section>
|
||||
|
||||
<style>
|
||||
.type-lead { margin-bottom: var(--space-4); }
|
||||
.type-body { margin-bottom: var(--space-5); }
|
||||
.type-lead { margin-bottom: var(--space-6); max-width: var(--measure); }
|
||||
|
||||
.demo {
|
||||
.demos {
|
||||
max-width: 1180px;
|
||||
margin-inline: auto;
|
||||
padding-inline: var(--gutter);
|
||||
display: grid;
|
||||
gap: var(--space-4);
|
||||
grid-template-columns: repeat(auto-fit, minmax(min(13rem, 100%), 1fr));
|
||||
margin-bottom: var(--space-5);
|
||||
gap: var(--space-6);
|
||||
}
|
||||
.demo-inner { padding: var(--space-4); }
|
||||
.demo-label {
|
||||
font-size: var(--mono-size);
|
||||
|
||||
.demo-title {
|
||||
font-size: var(--step-1);
|
||||
margin-bottom: var(--space-3);
|
||||
}
|
||||
|
||||
.demo-pair {
|
||||
display: grid;
|
||||
/* 폭을 좁게 고정한다. 넓으면 두 쪽이 같은 자리에서 끊겨 차이가 사라진다 */
|
||||
grid-template-columns: repeat(2, minmax(0, 15rem));
|
||||
gap: var(--space-5);
|
||||
align-items: start;
|
||||
}
|
||||
|
||||
.demo-side { min-width: 0; }
|
||||
|
||||
.demo-tag {
|
||||
font-size: var(--step--1);
|
||||
letter-spacing: var(--tracking-label);
|
||||
margin-bottom: var(--space-2);
|
||||
padding-bottom: var(--space-1);
|
||||
border-bottom: 1px solid var(--line);
|
||||
}
|
||||
.is-bad { color: var(--ink-muted); }
|
||||
.is-good { color: var(--accent); border-bottom-color: var(--accent); }
|
||||
|
||||
.demo-text {
|
||||
margin: 0;
|
||||
/* 줄바꿈 차이가 드러나도록 폭을 좁게 고정한다 */
|
||||
max-width: 13em;
|
||||
line-height: 1.7;
|
||||
font-size: var(--step-0);
|
||||
line-height: var(--leading-normal);
|
||||
word-break: keep-all;
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
|
||||
/* ---- 셋의 실제 차이 ------------------------------------- */
|
||||
/* 1) 줄바꿈 — 기본값은 어절 한가운데를 끊는다 */
|
||||
.bad-break { word-break: break-all; }
|
||||
.good-break { word-break: keep-all; }
|
||||
|
||||
/* 2) 행간 — 라틴 표준을 그대로 쓰면 받침이 붙어 보인다 */
|
||||
.bad-leading { line-height: 1.45; }
|
||||
.good-leading { line-height: 1.75; }
|
||||
|
||||
/* 3) 크기 — 라틴의 라벨 크기는 한글에서 획이 뭉갠다 */
|
||||
.bad-size { font-size: 11px; }
|
||||
.good-size { font-size: 15px; }
|
||||
|
||||
.demo-note {
|
||||
margin: var(--space-3) 0 0;
|
||||
font-size: var(--step-0);
|
||||
max-width: var(--measure);
|
||||
}
|
||||
/* 기본값 — 단어 중간에서 끊긴다 */
|
||||
.demo-default { word-break: break-all; }
|
||||
/* 우리 규칙 */
|
||||
.demo-keepall { word-break: keep-all; overflow-wrap: break-word; }
|
||||
|
||||
.type-rules {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
margin: var(--space-7) 0 0;
|
||||
padding: 0;
|
||||
display: grid;
|
||||
gap: 0;
|
||||
}
|
||||
.type-rules li {
|
||||
padding-block: var(--space-2);
|
||||
padding-block: var(--space-3);
|
||||
border-top: 1px solid var(--line);
|
||||
color: var(--ink-muted);
|
||||
}
|
||||
.type-rules li:last-child { border-bottom: 1px solid var(--line); }
|
||||
|
||||
@media (max-width: 760px) {
|
||||
.demo-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue