최신 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
인라인 요소에 bold 스타일이 적용될 경우 레이아웃 시프팅 현상이 발생하기 때문에 해당 이슈를 해결하는 방법들.
- html - Inline elements shifting when made bold on hover - Stack Overflow1
- Bold on Hover… Without the Layout Shift | CSS-Tricks2
Footnotes
-- 말줄임은 맥락마다 다르다
data Context = TableCell | Flex | Multiline -- Flex · Multiline 은 참고 링크로
-- 표 셀: overflow 셋은 잘라 낼 "경계" 가 있어야 먹는다
ellipsis :: Table -> Cell -> Bool
ellipsis t c = overflowTrio c && bounded
where bounded = hasWidth t && (layout t == Fixed || maxWidth c == Just 0)
-- 자동 레이아웃의 셀은 내용만큼 늘어난다 → 경계가 없다
-- Fixed: 열 너비를 표·col 너비로만 정한다 · maxWidth 0: CSS 2.1 미정의, 브라우저 관행
-- 표 width 없이 maxWidth 0 만 주면 열이 0 으로 접힌다
-- 셀에 버튼·배지가 같이 있으면 td { max-width: 0 } > div(flex, overflow hidden) > span 에 셋
-- TanStack Table: <colgroup> 에 header.getSize() 를 col 너비로, table-layout: fixed
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
A reset stylesheet (or CSS reset) is a collection of CSS rules used to clear the browser’s default formatting of HTML elements, removing potential inconsistencies between different browsers.
- An Interview With Elad Shechter on “The New CSS Reset” | CSS-Tricks1
- Modern CSS Reset / Global Styles2
- Notes on Josh Comeau’s Custom CSS Reset | CSS-Tricks - CSS-Tricks3
- Your CSS reset needs text-size-adjust (probably) | CSS-Tricks - CSS-Tricks4
Footnotes
-
all: unset;을 적용해서 reset 하는 방법을 제시하고 있다. ↩ -
box-sizing, 기본 margin 제거, percent 기반 높이, line-height 조정, font-smoothing, 미디어 타입 기본값, form 요소 글꼴 상속, 줄 바꿈, 루트 스태킹 컨텍스트로 구성된 초기화 ↩
-
Chris Coyier 가 위 Josh Comeau 리셋을 줄마다 평한 글. 브라우저 기본 스타일 차이가 줄어서 요즘 리셋은 “의견이 담긴 기본값 모음”에 가깝다는 관점 —
box-sizing은 상속 방식으로(컴포넌트에서 되돌리기 쉽게),margin: 0이면padding: 0도,-webkit-font-smoothing: antialiased전역 적용엔 반대, 글꼴 크기 기준은body가 아니라html(rem 의 root). ↩ -
text-size-adjust 관련한 상황들 ↩
- Animating with Clip-Path | CSS-Tricks
- Ghost Buttons with Directional Awareness in CSS | CSS-Tricks1
- Chameleonic Header | CodyHouse
- Using “box shadows” and clip-path together | CSS-Tricks2
mask — 현재 개체를 배경으로 합성하기 위한 알파 마스크를 정의
- Masking GIFs with other GIFs | CSS-Tricks
- Going From Solid to Knockout Text on Scroll | CSS-Tricks
- How to Create an Animated Chart of Nested Squares Using Masks | CSS-Tricks
Footnotes
- content-visibility: the new CSS property that boosts your rendering performance1
- More on content-visibility | CSS-Tricks2
- When is it “Right” to Reach for contain and will-change in CSS? - CSS-Tricks3
- contain - CSS: Cascading Style Sheets | MDN
- How I made Google’s data grid scroll 10x faster with one line of CSS | by Johan Isaksson | Oct, 2021 | Medium
Footnotes
-- web.dev 글은 다중 선택을 checkbox · select 두 방식으로 만든다. 여기 남긴 건 그 곁의 개수 세기·모바일 판별
-- 선택 개수: JS 없이 CSS 카운터로
filters :: [Input] -> Int
filters = length . filter checked -- counter-reset → :checked 마다 counter-increment
-- aside::after { content: counter(filters) }
-- 모바일 판별: @media (pointer: coarse)
-- 네이티브 select 를 버리지 않고 셋만 손댄다 (동작은 네이티브가)
style :: Select -> Css
style s = inheritFont -- font · letter-spacing · word-spacing: inherit
<> customArrow -- appearance: none + 직접 그린 화살표
<> stateStyles s -- :focus · :required · :invalid
-- placeholder 스타일: 지금은 하나
placeholderSelector :: Browser -> Selector
placeholderSelector Modern = "::placeholder" -- 2020 년부터 전 브라우저
placeholderSelector WebKit = "::-webkit-input-placeholder" -- Chrome · Safari · Opera (그 전)
placeholderSelector IE = ":-ms-input-placeholder"
placeholderSelector LegacyEdge = "::-ms-input-placeholder"
-- IE · 레거시 Edge 전용 컨트롤: ::-ms-clear (지우기) · ::-ms-reveal (비밀번호 보기)
- Creating websites with prefers-reduced-data | Polypane, The browser for ambitious developers1
- Modifying Specific Letters with CSS and JavaScript | CSS-Tricks2
- Stroke Text CSS: 📕 The Definitive Guide - Coding Dude3
- Use advanced typography with local fonts4
- Leading-Trim: The Future of Digital Typesetting | by Ethan Wang | Microsoft Design | Medium5
- Google Fonts6
- Using Font Variant Numeric7
- Color Fonts - Get ready for the revolution!
- How to Use Color Fonts on the Web
- Deep dive CSS: font metrics, line-height and vertical-align - Vincent De Oliveira
- Font size is useless; let’s fix it
- https://gwfh.mranftl.com/fonts/noto-sans-kr?subsets=korean,latin
폰트 만들기
- https://apps.apple.com/us/app/fontself-make-your-own-fonts/id1512959192
- https://glyphsapp.com/
- https://www.figma.com/community/file/1115382696459820988
- https://www.amygoodchild.com/blog/cursive-handwriting-in-javascript
Footnotes
-- Popover API 를 컴포넌트 모양으로 읽는다
data Mode = Auto | Hint | Manual -- popover 속성
data Action = Hide | Show | Toggle -- popovertargetaction (버튼의 popovertarget 이 대상)
data Popover = Popover { mode :: Mode, open :: Bool } -- open ↔ CSS :popover-open, 배경 ::backdrop
act :: Action -> Popover -> Popover -- hidePopover · showPopover · togglePopover
act Hide p = p { open = False }
act Show p = p { open = True }
act Toggle p = p { open = not (open p) }
-- 이벤트: beforetoggle (바뀌기 전) → toggle (바뀐 뒤)
-- 바탕 위에 흰색을 몇 % 덮어야 목표색이 되나: 합성식을 α 에 대해 푼다
-- 결과 = 덮는색·α + 바탕·(1 − α) (바탕이 불투명할 때)
alpha :: Channel -> Channel -> Double
alpha base target = (target - base) / (255 - base) -- 덮는색 = 흰색 255
alphas = zipWith alpha (rgb "#000000") (rgb "#D1D7DE") -- [0.82, 0.84, 0.87]
css = "rgba(255, 255, 255, " ++ fixed 2 (mean alphas) ++ ")" -- rgba(255, 255, 255, 0.84)
-- 채널별 α 가 다르면 평균 하나로는 정확히 못 맞춘다
over 0.84 white black == rgb 214 214 214 -- 목표는 rgb 209 215 222
-- @value 로 가져온 이름은 선언 값뿐 아니라 셀렉터 안에서도 치환된다
replaceSymbols :: Map Name String -> Rule -> Rule
replaceSymbols defs (Rule sel decls) = Rule (subst defs sel) (map (subst defs) decls)
-- icss-utils: decl 뿐 아니라 rule.selector 도 돈다
defs = fromList [("b", "_b_15lvz_1")] -- @value b from "./b.module.css"
replaceSymbols defs ".root :global(.b)" == ".root ._b_15lvz_1" -- 다른 모듈의 해시된 클래스
replaceSymbols empty ".root :global(.b)" == ".root .b" -- @value 없으면 아무것도 안 잡힌다-- 명시도가 같으면 뒤에 온 규칙이 이긴다 — 그러니 결과는 <head> 안 시트 순서가 정한다
winner = last . filter (matches el) . headOrder
-- 같은 두 시트인데 들어온 길에 따라 순서가 다르다
headOrder (Direct "/b") == [vendor, shared] -- .btn 파랑
headOrder (Navigate "/a" "/b") == [shared, vendor] -- .btn 회색: shared 는 /a 가 이미 불렀다
-- 순서를 바꾸는 곳 셋
inject sheets head = head ++ filter (`notElem` head) sheets -- 1 이미 있는 href 는 건너뛴다, App Router 는 지우지 않는다
-- 2 빌드 청킹: 14.2.0 의 새 CSS 청킹(#63157)이 여러 페이지 CSS 를 한 청크로
-- global CSS 병합 수정 #67373 (v15 canary~, 14.2.x 엔 없다) · CSS Modules 순서 #70087 열림
-- 3 Pages Router 는 반대 증상: 이동 뒤 서버 렌더 시트(data-n-p)를 지우는데
-- 동적 import CSS 는 이미 있어 건너뛰었으므로 아예 사라진다 → #72959-- Less 변수는 값 자리뿐 아니라 이름 자리에도 들어간다
lookup :: Env -> Name -> Value
color = lookup env "primary" -- @primary
selector = "." ++ show (lookup env "component") -- .@{component} → .button (따옴표를 넣으면 .'button')
property = "background-" ++ show (lookup env "property") -- background-@{property}
icon = path ++ "/icon.svg" -- url('@{path}/icon.svg')
indirect = lookup env (show (lookup env "theme")) -- @@theme → @primary 의 값
fromMap = lookup (lookup env "colors") "primary" -- @colors[primary] (3.5+)
escaped = raw ("--" ++ prefix ++ "-color") -- ~'…' 따옴표 없이 그대로. CSS 변수 이름 조합에
-- :root { --primary: @primary; } 로 CSS 변수에 넘긴다
-- 스피너가 한 프레임 번쩍하거나, 떴다가 하드컷으로 끊긴다: 깜빡임은 양 끝에서 따로 생긴다
-- 보인 구간 [뜬 시각, 사라진 시각) — DOM 에 붙어 있던 시간이 아니다
shown :: Delay -> MinShow -> Response -> Interval
shown delay minShow res
| res < delay = empty -- 앞쪽: CSS animation-delay 가 통째로 건너뛴다
| otherwise = (delay, max res (delay + minShow)) -- 뒤쪽: 끝은 응답 시각인데 CSS 는 그걸 모른다
-- → JS(useMinimumLoading)가 unmount 를 민다
-- 최소 노출은 처음 보인 시각부터 잰다. 요청 시점부터 재면 안 떠도 될 스피너를 붙잡는다
-- @starting-style 은 진입의 출발값만 정한다 — 지연 0 이면 앞쪽을 못 막는다
-- 실측 (Chrome 154, CDP 로 응답을 붙잡고 프로브·스크린샷 trace 로 잼, ms)
-- 지연 응답 최소노출 보인 시간
-- 0 100 — 133 앞쪽
-- 300 100 — 0 억제
-- 300 350 — 66 뒤쪽: 페이드가 끝나기 전에 끊겨 한 번도 진해지지 못한다
-- 300 350 500 515 뒤쪽 잡힘
-- 300 100 500 0 억제 유지- How to Modify Nodes in an Abstract Syntax Tree | CSS-Tricks1
- AST for JavaScript developers. TL;DR This article is my talk for… | by Bohdan Liashenko | ITNEXT2
- GitHub - NV/CSSOM: Unmaintained! ⚠️ CSS Object Model implemented in pure JavaScript. Also, a CSS parser.3
- GitHub - csstree/csstree: A tool set for CSS including fast detailed parser, walker, generator and lexer based on W3C specs and browser implementations
Footnotes
hash 링크로 연결될 경우 스크롤위치가 최상단으로 위치하기 때문에 문제(헤더가 고정일 경우)가 있을수도 있어서 scroll-margin-top으로 제어가 가능한 부분을 설명하고 있다.
- Add scroll margin to all elements which can be targeted - Piccalilli1
- Fixed Headers and Jump Links? The Solution is scroll-margin-top | CSS-Tricks
- Prevent content from being hidden underneath a fixed header by using scroll-margin-top – Bram.us
Footnotes
-
2ex유닛을 사용하여 선택한 글꼴의 x 높이의 상대적인 크기로 설정. ↩