The clamp() CSS function clamps a value within a range of values between a defined minimum bound and a maximum bound. The function takes three parameters: a minimum value, a preferred value, and a maximum allowed value.
- Clamp | Utopia1
- Linearly Scale font-size with CSS clamp() Based on the Viewport | CSS-Tricks2
- Modern Fluid Typography Using CSS Clamp — Smashing Magazine
Footnotes
텍스트 ellipsis는 컨텍스트마다 패턴이 다르다.
언제 — 먼저 어느 컨텍스트인지 가른다.
| 컨텍스트 | 어디로 |
|---|---|
display: table-cell |
아래 절차 |
| flexbox | 맨 아래 참고 링크 |
| 여러 줄(multiline) | 맨 아래 참고 링크 |
table cell
절차
- 표에
table-layout: fixed를 준다. - 셀에
max-width: 0과overflow: hidden셋을 함께 준다.
table {
table-layout: fixed;
width: 100%;
}
col:nth-child(1) { width: 30%; }
col:nth-child(2) { width: 40%; }
col:nth-child(3) { width: 30%; }
td {
max-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
확인: 긴 텍스트가 든 셀이 표를 옆으로 밀어내지 않고 …로 잘리는가.
함정 — table-layout: fixed와 max-width: 0은 반드시 함께여야 한다. overflow 셋만 주면 아무 효과가 없다.
/* ❌ 아무 효과 없음 */
td {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
display: table-cell은 width 제약 없이 content 크기에 맞게 늘어나서, overflow가 동작할 명시적 width bound가 없기 때문이다. 그리고 max-width: 0이 실제 0px이 되는 게 아니다 — table-layout: fixed 안에서 “이 셀은 content 기반으로 너비를 주장하지 않는다”는 시그널로 작동해, colgroup/th에서 받은 너비 안에서 overflow가 동작한다.
컬럼별 선택적 적용
td:not(.col-action) {
max-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
td.col-action {
white-space: nowrap;
}
셀 안에 복합 요소
버튼/배지 등이 텍스트와 함께 있을 때 inner wrapper에 위임.
td {
max-width: 0;
}
td > div {
display: flex;
align-items: center;
gap: 6px;
overflow: hidden;
}
td > div > span {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
min-width: 0;
}
React 컴포넌트 패턴
TanStack Table size 옵션과 조합.
const columns = [
columnHelper.accessor('name', {
size: 200,
cell: ({ getValue }) => (
<span style={{ display: 'block', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>
{getValue()}
</span>
),
}),
]
<table style={{ tableLayout: 'fixed', width: '100%' }}>
<colgroup>
{table.getFlatHeaders().map(header => (
<col key={header.id} style={{ width: header.getSize() }} />
))}
</colgroup>
...
</table>
재사용 셀 래퍼:
function EllipsisCell({ children }: { children: React.ReactNode }) {
return (
<td style={{ maxWidth: 0 }}>
<div style={{
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
}}>
{children}
</div>
</td>
)
}
flexbox / multiline 참고
- Using Flexbox and text ellipsis together · Leonardo Faria1
- Multiline truncated text with “show more” button (with just CSS) - Paul Bakaus’ blog2
- Recreating MDN’s Truncated Text Effect
Footnotes
인라인 요소에 bold 스타일이 적용될 경우 레이아웃 시프팅 현상이 발생하기 때문에 해당 이슈를 해결하는 방법들.
- html - Inline elements shifting when made bold on hover - Stack Overflow1
- Bold on Hover… Without the Layout Shift | CSS-Tricks2
Footnotes
최신 CSS 기능 및 트렌드
- Things You Can Do With CSS Today — Smashing Magazine
- The Future of CSS: Cascade Layers (CSS @layer)
- The Undeniable Utility Of CSS :has • Josh W. Comeau
- An Interactive Guide to CSS Container Queries
- 컨테이너 쿼리 사용 방법 | web.dev
- What if you used Container Units for everything?
레이아웃과 반응형 디자인
- Fluid Sizing Instead Of Multiple Media Queries? — Smashing Magazine
- Complex conditional width using flex-basis with clamp
- Using grid to split a table cell
- TablesNG — Improvements to
<table>rendering in Chromium
CSS 애니메이션 및 효과
- A CSS-only, animated, wrapping underline.
- Cubic Bézier: from math to motion
- Zero Trickery Custom Radios and Checkboxes - CSS-Tricks
- CSS One-Liners to Improve (Almost) Every Project
- 6 CSS Snippets Every Front-End Developer Should Know In 2025
텍스트 및 타이포그래피
스타일 가이드 및 접근성
- Naming Variables In CSS
- Margin considered harmful
- Defensive CSS - Ahmad Shadeed
- The wasted potential of CSS attribute selectors
CSS와 JavaScript의 조합
- Constructable Stylesheets: seamless reusable styles
- Replace JavaScript Dialogs With New HTML Dialog | CSS-Tricks
- How to prevent scrolling the page on iOS Safari 15
CSS 아키텍처 및 모듈화
background
git checkout -- <file>
git restore <file>
git reset --hard
리모트 브랜치 가져오기
git remote update
Footnotes
-
명령어로 discard를 하려면 ↩
# 마지막 커밋 해시
git log --pretty=format:'%h' -n 1
# 유저정보
git config user.name
git config user.email
Using Slack Slash Commands to Send Data from Slack into Google Sheets
순서를 기억하려고 적어둔 것이다. 방법은 위 링크에 있다.
- 사람들이 추천한 책을 기록한다
- 슬랙 -> 구글시트
- 슬랙 커맨드 설정
/book+ 구글앱스 스크립트 url 연결1 - POST로 전송 받은 데이터값을 기반으로 데이터 처리 완료
Footnotes
-
꿀벌개발일지 :: 구글 앱스 스크립트에서 비동기 작업 추가하기 doPost에서 비동기 처리 ↩
- 파일질라 서버를 설치
- Edit->Users->Add / 사용자 추가
- 제어판->시스템 및 보안->Windows Defender 방화벽->허용되는 앱 / (설정변경|다른 앱 허용) 파일질라 서버 추가