diff --git a/index.html b/index.html index 6a77f68..eb667b1 100644 --- a/index.html +++ b/index.html @@ -22,6 +22,7 @@ @@ -213,6 +214,44 @@

Forms

+
+
+

File Input

+

운영체제 파일 선택기와 브라우저의 선택 상태를 별도 업로드 코드 없이 사용합니다.

+
+
+
+

local source review

+

예제 파일 선택

+
+ +

+ HTML과 CSS 파일을 여러 개 선택할 수 있습니다. 선택한 파일은 이 데모 밖으로 전송되지 않습니다. +

+
+
+
선택 상태
+
브라우저가 파일 이름과 선택 개수를 표시합니다.
+
+
+
키보드
+
Tab으로 이동한 뒤 Enter 또는 Space로 파일 선택기를 엽니다.
+
+
+
+
+

Selectors

diff --git a/styles.css b/styles.css index ea31fc3..7bfacd9 100644 --- a/styles.css +++ b/styles.css @@ -325,6 +325,91 @@ gap: 14px; } + .file-card { + display: grid; + gap: 18px; + } + + .file-card h3 { + margin: 0; + } + + .component-kicker { + margin: 0 0 6px; + color: var(--color-focus); + font-size: 11px; + font-weight: 900; + letter-spacing: 0.08em; + text-transform: uppercase; + } + + .file-field { + gap: 10px; + } + + .file-input { + width: 100%; + min-height: 60px; + border-style: dashed; + padding: 8px; + color: var(--color-muted); + background: var(--color-surface-muted); + cursor: pointer; + transition: + border-color var(--motion-standard), + background var(--motion-standard); + } + + .file-input:hover { + border-color: var(--color-focus); + background: var(--color-surface-selected); + } + + .file-input::file-selector-button { + min-height: 42px; + margin-right: 12px; + border: 0; + border-radius: 6px; + padding: 0 14px; + color: var(--color-primary-ink); + background: var(--color-primary); + font: inherit; + font-weight: 800; + cursor: pointer; + transition: background var(--motion-standard); + } + + .file-input:hover::file-selector-button { + background: var(--color-primary-hover); + } + + .file-context { + display: grid; + grid-template-columns: repeat(2, minmax(0, 1fr)); + gap: 8px; + margin: 0; + } + + .file-context div { + border: 1px solid var(--color-border); + border-radius: var(--radius-frame); + padding: 12px; + background: var(--color-surface-muted); + } + + .file-context dt { + margin-bottom: 4px; + font-size: 13px; + font-weight: 900; + } + + .file-context dd { + margin: 0; + color: var(--color-muted); + font-size: 13px; + line-height: 1.55; + } + .matrix-card { display: grid; gap: 16px; @@ -479,7 +564,7 @@ } } - input:not([type='radio']):not([type='checkbox']), + input:not([type='radio']):not([type='checkbox']):not([type='file']), select { min-height: 44px; border: 1px solid var(--color-border-strong); @@ -694,4 +779,8 @@ .command-links { grid-template-columns: 1fr; } + + .file-context { + grid-template-columns: 1fr; + } }