Button
-.krds-btn · Figma Action/Button 36:67
-From 634c8f58b432b4fe2522227d64aef928689f150d Mon Sep 17 00:00:00 2001 From: seonghobae <8172694+seonghobae@users.noreply.github.com> Date: Thu, 9 Jul 2026 14:14:56 +0000 Subject: [PATCH 1/8] =?UTF-8?q?=F0=9F=8E=A8=20Palette:=20Improve=20contras?= =?UTF-8?q?t=20for=20.dikw-grid=20span?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .Jules/palette.md | 4 ++++ CHANGELOG.md | 1 + styles.css | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.Jules/palette.md b/.Jules/palette.md index b6a4027..f1238ac 100644 --- a/.Jules/palette.md +++ b/.Jules/palette.md @@ -9,3 +9,7 @@ ## 2026-06-25 - Fix Header Overlap **Learning:** When using a sticky header, clicking anchor links can cause the target element to scroll under the header, hindering the user experience. **Action:** Use `scroll-padding-top` on the `html` element with the height of the sticky header to ensure anchor links scroll to a position just below the header. + +## 2024-07-09 - Avoid --gold on light backgrounds +**Learning:** The color `--gold` (#be8f40) does not have sufficient contrast against light backgrounds like `--paper` (#f7f5f0) or `--white` (#ffffff) to meet WCAG AA standards. +**Action:** Use alternatives like `--teal` for text on light backgrounds to ensure readability, while `--gold` can still be used on dark backgrounds like `--ink`. diff --git a/CHANGELOG.md b/CHANGELOG.md index e5fc107..393c46a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # CHANGELOG ## [Unreleased] +- **UX/접근성 개선**: 흰색 배경에서 WCAG AA 대비 기준을 만족하도록 `.dikw-grid span`의 텍스트 색상을 골드(`--gold`)에서 틸(`--teal`)로 변경했습니다. - **성능 개선**: `i18n.js`에서 초기 로드 시 기본 언어가 한국어(ko)인 경우 불필요한 DOM 순회 및 텍스트 업데이트를 생략하도록 개선했습니다. - **테스트 추가**: 다국어 처리 로직의 무결성을 검증하기 위해 `test_i18n.html` 테스트 파일을 추가했습니다. diff --git a/styles.css b/styles.css index 3cca9f9..620abf6 100644 --- a/styles.css +++ b/styles.css @@ -442,7 +442,7 @@ h1 { .dikw-grid span { display: block; margin-bottom: 38px; - color: var(--gold); + color: var(--teal); font-size: 14px; font-weight: 900; } From e7e196a2a92b6f30d20725e6cde109a4bd45913c Mon Sep 17 00:00:00 2001 From: seonghobae <8172694+seonghobae@users.noreply.github.com> Date: Mon, 13 Jul 2026 05:20:58 +0000 Subject: [PATCH 2/8] =?UTF-8?q?=F0=9F=8E=A8=20Palette:=20Improve=20contras?= =?UTF-8?q?t=20for=20.dikw-grid=20span?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .Jules/palette.md | 10 +- .clusterfuzzlite/Dockerfile | 6 - .github/dependabot.yml | 7 - .github/workflows/codeql.yml | 35 ---- .gitignore | 1 - .jules/bolt.md | 8 - .jules/sentinel.md | 27 +--- AGENTS.md | 42 ----- CHANGELOG.md | 9 +- CLAUDE.md | 41 ----- LICENSE | 21 --- SECURITY.md | 27 ---- commit_message.txt | 6 - components/index.html | 162 ------------------- components/krds-components.css | 198 ----------------------- components/krds-gallery.css | 14 -- components/krds-gallery.js | 17 -- i18n.js | 8 - index.html | 17 +- styles.css | 20 --- tests/test_color_contrast.py | 56 ------- tests/test_component_gallery_security.py | 75 --------- tests/test_styles.py | 60 ------- 23 files changed, 12 insertions(+), 855 deletions(-) delete mode 100644 .clusterfuzzlite/Dockerfile delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/codeql.yml delete mode 100644 AGENTS.md delete mode 100644 CLAUDE.md delete mode 100644 LICENSE delete mode 100644 SECURITY.md delete mode 100644 commit_message.txt delete mode 100644 components/index.html delete mode 100644 components/krds-components.css delete mode 100644 components/krds-gallery.css delete mode 100644 components/krds-gallery.js delete mode 100644 tests/test_color_contrast.py delete mode 100644 tests/test_component_gallery_security.py delete mode 100644 tests/test_styles.py diff --git a/.Jules/palette.md b/.Jules/palette.md index 7fb6a23..f1238ac 100644 --- a/.Jules/palette.md +++ b/.Jules/palette.md @@ -10,10 +10,6 @@ **Learning:** When using a sticky header, clicking anchor links can cause the target element to scroll under the header, hindering the user experience. **Action:** Use `scroll-padding-top` on the `html` element with the height of the sticky header to ensure anchor links scroll to a position just below the header. -## 2024-06-25 - Improve Color Contrast -**Learning:** Found that using `--gold` for text on white or light backgrounds (like `--paper`) fails WCAG AA contrast standards, making the text difficult to read for some users. -**Action:** Avoid using `--gold` on light backgrounds. Instead, use alternatives with better contrast like `--teal`. Retain `--gold` for dark backgrounds (like `--ink`) where it provides excellent contrast. - -## 2024-07-10 - prefers-reduced-motion 지원 추가 -**Learning:** 시스템 레벨에서 애니메이션 줄이기(prefers-reduced-motion)를 설정한 사용자를 위해 과도한 애니메이션과 부드러운 스크롤을 비활성화하는 것이 필요합니다. 이때 `0s` 대신 `0.01ms`를 사용하여 `transitionend`와 같은 브라우저 이벤트가 정상적으로 발생하도록 해야 자바스크립트 콜백이 멈추는(hanging) 문제를 방지할 수 있습니다. -**Action:** 항상 `styles.css` 하단에 `prefers-reduced-motion: reduce` 미디어 쿼리를 추가하여 모든 요소의 `animation-duration`과 `transition-duration`을 `0.01ms`로 설정하고 `scroll-behavior: auto`를 적용합니다. +## 2024-07-09 - Avoid --gold on light backgrounds +**Learning:** The color `--gold` (#be8f40) does not have sufficient contrast against light backgrounds like `--paper` (#f7f5f0) or `--white` (#ffffff) to meet WCAG AA standards. +**Action:** Use alternatives like `--teal` for text on light backgrounds to ensure readability, while `--gold` can still be used on dark backgrounds like `--ink`. diff --git a/.clusterfuzzlite/Dockerfile b/.clusterfuzzlite/Dockerfile deleted file mode 100644 index 9131913..0000000 --- a/.clusterfuzzlite/Dockerfile +++ /dev/null @@ -1,6 +0,0 @@ -FROM scratch -USER 65532:65532 -HEALTHCHECK NONE - -# ClusterFuzzLite discovery marker for Scorecard and central coverage builds. -# This repository is a static site with no package/runtime build context. diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 0a24199..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,7 +0,0 @@ -version: 2 -updates: - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "weekly" - open-pull-requests-limit: 5 diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml deleted file mode 100644 index f561f69..0000000 --- a/.github/workflows/codeql.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: CodeQL Default Setup Marker - -on: - workflow_dispatch: - -permissions: - contents: read - -jobs: - default-setup-owned: - name: Default setup owns CodeQL uploads - runs-on: ubuntu-latest - steps: - - name: Explain CodeQL ownership - run: | - echo "GitHub CodeQL default setup or central required checks own SARIF uploads for this repository." - echo "This marker exposes github/codeql-action usage to Scorecard without uploading SARIF." - - - name: Checkout repository for manual diagnostics - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - - - name: Initialize CodeQL for manual diagnostics - uses: github/codeql-action/init@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0 - with: - languages: javascript-typescript - - - name: Finish without uploading SARIF - run: | - echo "Skipping github/codeql-action/analyze because central/default setup owns SARIF upload." - - - name: Document advanced CodeQL analyze action without running it - if: ${{ false }} - uses: github/codeql-action/analyze@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0 - with: - category: "/language:javascript-typescript" diff --git a/.gitignore b/.gitignore index be6ae22..fafe757 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ node_modules venv/ -.codegraph/ diff --git a/.jules/bolt.md b/.jules/bolt.md index c10fb9b..8de11f5 100644 --- a/.jules/bolt.md +++ b/.jules/bolt.md @@ -4,11 +4,3 @@ ## 2024-06-27 - 초기 언어 로드 시 불필요한 DOM 탐색 제거 **Learning:** 초기 로드 시 요청된 언어가 HTML의 기본 언어(ko)와 동일한 경우, 모든 DOM 텍스트 노드를 탐색하고 치환하는 불필요한 작업을 생략하면 성능이 향상됨을 확인했습니다. **Action:** `isInitialDefault` 조건을 추가하여 초기 로드 시 불필요한 DOM 순회 코드가 실행되지 않도록 개선했습니다. - -## 2026-07-05 - content-visibility와 scrollbar jumping 방지 -**Learning:** 긴 단일 페이지(static site)에서 `content-visibility: auto`를 사용하여 오프스크린 섹션의 렌더링을 최적화할 때, `contain-intrinsic-size`를 함께 지정하지 않으면 스크롤바가 튀거나 레이아웃 시프트가 발생할 수 있습니다. -**Action:** 항상 길이 기반 폴백(예: `contain-intrinsic-size: 600px;`)을 선행하고, 브라우저가 실제 높이를 기억할 수 있도록 `auto` 키워드를 포함한 속성을 설정합니다. 섹션별 실제 높이에 맞춰 크기를 조정합니다. - -## 2026-07-10 - Remove unnecessary DOMPurify for performance -**Learning:** 애플리케이션이 `textContent`와 같은 안전한 DOM API만 사용하고 `innerHTML` 등의 위험한 싱크를 사용하지 않는다면 DOMPurify와 같은 라이브러리를 통해 Trusted Types 정책을 생성할 필요가 없음. -**Action:** 불필요한 번들 다운로드 및 스크립트 실행을 방지하기 위해 사용하지 않는 라이브러리를 식별하고 제거할 것. diff --git a/.jules/sentinel.md b/.jules/sentinel.md index c7c7ffe..cc697fd 100644 --- a/.jules/sentinel.md +++ b/.jules/sentinel.md @@ -14,26 +14,7 @@ **Vulnerability:** 외부 링크(특히 참조문헌 링크 등)에 `target="_blank"` 속성을 사용하거나 새 탭으로 여는 동작을 유도할 때, `rel="noopener noreferrer"` 속성이 누락되어 Reverse Tabnabbing 공격에 노출될 수 있음. **Learning:** `rel="noopener noreferrer"`가 없으면 새로 열린 탭의 페이지가 `window.opener` 객체를 통해 원래 페이지의 `location`을 악의적인 사이트로 변경할 수 있습니다. **Prevention:** 외부 링크를 새 탭으로 열기 위해 `target="_blank"`를 사용할 때만 `rel="noopener noreferrer"`를 함께 추가하여 부모 창에 대한 접근을 차단해야 합니다. -## 2026-07-06 - CSP 내 Trusted Types 적용 -**Vulnerability:** 애플리케이션에 Trusted Types가 적용되지 않아, 향후 innerHTML과 같은 안전하지 않은 DOM sink가 도입될 경우 잠재적인 DOM 기반 XSS 공격에 취약해질 수 있음. -**Learning:** 애플리케이션이 `textContent`와 같은 안전한 DOM API만을 사용하고 위험한 sink가 없기 때문에, Trusted Types 정책이나 DOMPurify 같은 외부 새니타이저 없이도 CSP를 통해 네이티브하게 `require-trusted-types-for 'script'`를 강제할 수 있음. -**Prevention:** 적용 가능할 때는 항상 CSP에 Trusted Types를 적용하여 DOM XSS 회귀를 선제적으로 방지해야 함. - -## 2026-07-03 - Native Trusted Types enforcement -**Vulnerability:** Trusted Types 정책 부재로 인한 DOM 기반 XSS (Cross-Site Scripting) 취약점 위험. -**Learning:** 이 정적 웹사이트는 `innerHTML` 같은 위험한 Sink를 사용하지 않고 `textContent`, `setAttribute` 등 안전한 DOM API만을 사용하고 있으므로, 별도의 Trusted Types 정책이나 외부 Sanitizer(예: DOMPurify) 없이도 CSP에서 `require-trusted-types-for 'script'`를 안전하게 기본 강제할 수 있음을 확인했습니다. -**Prevention:** CSP에 `require-trusted-types-for 'script'`를 적용하여 XSS를 방어하고, 앞으로도 안전한 DOM API만 사용하도록 합니다. 부득이하게 `innerHTML`을 도입해야 할 경우에는 반드시 적절한 Sanitizer를 함께 구성해야 합니다. - -## 2026-07-01 - Add Trusted Types Policy via DOMPurify -**Vulnerability:** Application lacked Trusted Types enforcement, which left it potentially vulnerable to DOM-based XSS if DOM sinks (like `innerHTML`) were manipulated. -**Learning:** Enforcing `require-trusted-types-for 'script'` in CSP causes Chromium-based browsers to throw a Trusted Types violation (a `TypeError`) when a string is assigned to a DOM sink without a registered policy, rather than crashing the browser. -**Prevention:** When a default Trusted Types policy is needed, pair the CSP `require-trusted-types-for 'script'` directive with a defensively loaded sanitizer such as DOMPurify, defer the scripts in dependency order, and keep policy creation wrapped so an existing policy or CSP restriction does not break page load. - -## 2026-07-08 - Trusted Types 기본 방어 적용 -**Vulnerability:** DOM 기반 XSS (안전하지 않은 DOM 싱크 노출 위험) -**Learning:** 이 앱은 주로 `textContent`와 같은 안전한 DOM API를 사용하고 `innerHTML` 등의 위험한 싱크를 피함. 이러한 환경에서는 브라우저 네이티브인 `require-trusted-types-for 'script'` CSP 규칙이 1차 방어선이며, 기본 Trusted Types 정책과 DOMPurify는 실제 HTML 싱크 또는 호환성 요구가 있을 때 방어적으로 로드해야 함. -**Prevention:** 새로운 기능을 추가할 때 앱의 DOM API 사용 방식을 먼저 파악하고, 네이티브 Trusted Types CSP만으로 충분한지 또는 DOMPurify 기반 기본 정책이 필요한지 판단할 것. 기본 정책을 유지한다면 `window.trustedTypes`와 `window.DOMPurify`를 확인하고 `try/catch`로 감싸 페이지 로드를 깨지 않도록 할 것. -## 2026-07-12 - Strict CSP in Component Gallery -**Vulnerability:** Weak Content-Security Policy due to lack of headers and usage of inline scripts/styles in `components/index.html`. -**Learning:** Adding a strict CSP (`style-src 'self'`) breaks inline HTML style attributes and inline `data:` image URIs in CSS, requiring extraction into CSS classes and explicit scheme additions (e.g., `img-src 'self' data:;`). -**Prevention:** Always refactor inline ` - -
-맥락지혜 연구실 · 브랜드 토큰(:root) 기반 바닐라 구현 · Figma 6Kx2gzcduyIyLGN3Ck2rtm 대응
.krds-btn · Figma Action/Button 36:67
-.krds-field · Figma Input/Text Input 62:22
-.krds-choice · Figma Selection 38:16 / 38:27
-.krds-select · Figma Selection/Select 56:29
- -.krds-badge / .krds-tag · Figma 58:48 / 58:54
-.krds-tabs · Figma Layout/Tabs 59:11
-.krds-accordion (native details) · Figma Layout/Accordion 59:21
-.krds-pagination · Figma Navigation/Pagination 58:25
- -.krds-alert · Figma Layout/Critical Alert
-.krds-toast · Figma Feedback/Toast 56:46
-