select 에는 placeholder 속성이 없다. 값이 빈 문자열인 첫 option 을 두고 disabled 로 다시 고르지 못하게, hidden 으로 목록에서 숨긴다. required 이면 스펙상 그 option 이 placeholder label option 이 되어 고르지 않고 제출하면 막힌다. React 에서는 option 의 selected 대신 select 의 defaultValue=“” 로 처음에 그것을 고른다.

-- select 에는 placeholder 가 없다 → 값이 "" 인 첫 option 이 그 노릇을 한다
placeholderOption :: String -> Option
placeholderOption label = Option { value = "", disabled = True, hidden = True, text = label }

valid :: Select -> Bool
valid s = not (required s) || value s /= ""    -- required 면 placeholder label option 으로는 제출이 막힌다

-- React: <option selected> 대신 <select defaultValue="">
#132

다중 선택 필터에서 선택된 개수는 JS 없이 CSS 카운터로 센다. 컨테이너에서 counter-reset 으로 0 부터 시작하고, :checked 인 항목마다 counter-increment 로 하나씩 올리고, ::after 의 content: counter(filters) 로 보여 준다. 모바일 판별은 @media (pointer: coarse) 로 한다.

-- 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)
#133

네이티브 select 를 버리지 않고 손대는 건 셋이다. font·letter-spacing·word-spacing 을 부모에서 상속받게 하고, appearance 를 꺼서 화살표를 직접 그리고, focus·required·invalid 상태마다 스타일을 준다. 키보드·스크린리더 동작은 네이티브가 그대로 맡는다.

-- 네이티브 select 를 버리지 않고 셋만 손댄다 (동작은 네이티브가)
style :: Select -> Css
style s = inheritFont          -- font · letter-spacing · word-spacing: inherit
       <> customArrow          -- appearance: none + 직접 그린 화살표
       <> stateStyles s        -- :focus · :required · :invalid
#134

textarea·select·input 은 기본적으로 고정 크기라 내용이 넘치면 스크롤된다. CSS 한 줄 field-sizing: content 를 주면 내용에 맞춰 크기가 정해져, 글을 칠수록 textarea 가 늘어나고 input 도 글자 수만큼 넓어진다. JS 로 높이를 재던 자동 크기 조절이 필요 없다.

-- CSS 한 줄로 내용 기반 크기 조절 — textarea 뿐 아니라 select·input 에도
size :: FieldSizing -> Element -> Size
size Fixed   el = defaultSize el      -- 기본: 고정 크기, 넘치면 스크롤
size Content el = contentSize el      -- 내용만큼 — JS 로 높이를 재던 자동 크기 조절이 필요 없다

-- textarea, select, input { field-sizing: content; }
#358