Merge pull request 'auto: PR for feat/style-tokens-regression' (#77) from feat/style-tokens-regression into main
CI / test (push) Successful in 1m0s
CI / test (push) Successful in 1m0s
This commit was merged in pull request #77.
This commit is contained in:
@@ -199,6 +199,16 @@
|
|||||||
- 오류 원인/디버깅
|
- 오류 원인/디버깅
|
||||||
- 없음(스냅샷은 정규식 매칭으로 안정화)
|
- 없음(스냅샷은 정규식 매칭으로 안정화)
|
||||||
|
|
||||||
|
### 스타일 토큰 회귀 강화(링/비활성) (2025-11-17)
|
||||||
|
- TDD
|
||||||
|
- `lib/wysiwyg/export.style.tokens.focusVisible.test.ts`: `--ring`, `--ring-offset` 토큰 존재 및 `:focus-visible`에서 outline/offset 참조 검증
|
||||||
|
- `lib/wysiwyg/export.style.tokens.disabled.test.ts`: `--disabled-bg`, `--disabled-fg` 토큰 존재 및 `:disabled`/`[readonly]`에서 참조 검증
|
||||||
|
- 구현: `lib/wysiwyg/export.ts`
|
||||||
|
- :root/테마 토큰에 `--ring`, `--ring-offset`, `--disabled-bg`, `--disabled-fg` 추가
|
||||||
|
- 규칙 추가: `:focus-visible{outline:2px solid var(--ring);outline-offset:var(--ring-offset)}`
|
||||||
|
- 규칙 추가: `input,select,textarea:disabled{background:var(--disabled-bg);color:var(--disabled-fg)}` / `[readonly]{color:var(--disabled-fg)}`
|
||||||
|
- 결과: 전체 테스트 그린(166 파일 / 291 테스트)
|
||||||
|
|
||||||
### Guides/그룹 액션 완성(드래그/리사이즈/회전 + 스냅) (2025-11-17)
|
### Guides/그룹 액션 완성(드래그/리사이즈/회전 + 스냅) (2025-11-17)
|
||||||
- TDD
|
- TDD
|
||||||
- `components/wysiwyg/WysiwygBuilder.guides.acceptance.test.tsx`: Guides 토글 ON/OFF 표시 확인
|
- `components/wysiwyg/WysiwygBuilder.guides.acceptance.test.tsx`: Guides 토글 ON/OFF 표시 확인
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import { describe, it, expect } from 'vitest'
|
||||||
|
import { exportFrame } from '@/lib/wysiwyg/export'
|
||||||
|
import type { Frame } from '@/lib/wysiwyg/schema'
|
||||||
|
|
||||||
|
function baseFrame(): Frame {
|
||||||
|
return {
|
||||||
|
id: 'f', width: 320, height: 200, background: '#111111',
|
||||||
|
layers: [{ id: 'l1', name: 'Base', visible: true, locked: false, objects: [] }],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
describe('wysiwyg export - disabled/read-only control tokens', () => {
|
||||||
|
it('defines disabled tokens and uses them for :disabled and [readonly]', () => {
|
||||||
|
const out = exportFrame(baseFrame())
|
||||||
|
// tokens
|
||||||
|
expect(out.css).toMatch(/:root\s*{[^}]*--disabled-bg:/)
|
||||||
|
expect(out.css).toMatch(/:root\s*{[^}]*--disabled-fg:/)
|
||||||
|
// usage
|
||||||
|
expect(out.css).toMatch(/input:disabled,select:disabled,textarea:disabled\s*{[^}]*background:var\(--disabled-bg\)/)
|
||||||
|
expect(out.css).toMatch(/input:disabled,select:disabled,textarea:disabled\s*{[^}]*color:var\(--disabled-fg\)/)
|
||||||
|
expect(out.css).toMatch(/input\[readonly\],select\[readonly\],textarea\[readonly\]\s*{[^}]*color:var\(--disabled-fg\)/)
|
||||||
|
})
|
||||||
|
})
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
import { describe, it, expect } from 'vitest'
|
||||||
|
import { exportFrame } from '@/lib/wysiwyg/export'
|
||||||
|
import type { Frame } from '@/lib/wysiwyg/schema'
|
||||||
|
|
||||||
|
function baseFrame(): Frame {
|
||||||
|
return {
|
||||||
|
id: 'f', width: 320, height: 200, background: '#111111',
|
||||||
|
layers: [{ id: 'l1', name: 'Base', visible: true, locked: false, objects: [] }],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
describe('wysiwyg export - focus-visible ring tokens', () => {
|
||||||
|
it('defines ring tokens and uses them in :focus-visible styles', () => {
|
||||||
|
const out = exportFrame(baseFrame())
|
||||||
|
// tokens
|
||||||
|
expect(out.css).toMatch(/:root\s*{[^}]*--ring:/)
|
||||||
|
expect(out.css).toMatch(/:root\s*{[^}]*--ring-offset:/)
|
||||||
|
// usage (focus-visible across common focusables and controls)
|
||||||
|
expect(out.css).toMatch(/:focus-visible\s*{[^}]*outline:2px solid var\(--ring\)/)
|
||||||
|
expect(out.css).toMatch(/:focus-visible\s*{[^}]*outline-offset:var\(--ring-offset\)/)
|
||||||
|
})
|
||||||
|
})
|
||||||
@@ -120,15 +120,18 @@ export function exportFrame(frame: Frame): Exported {
|
|||||||
}
|
}
|
||||||
const inner = `<div class="frame-scale"><div class="frame">${piecesHtml.join('')}</div></div>`
|
const inner = `<div class="frame-scale"><div class="frame">${piecesHtml.join('')}</div></div>`
|
||||||
const css = [
|
const css = [
|
||||||
`:root{--bg:${frame.background};--text:#f9fafb;--border:#94a3b8;--primary:#0ea5e9;--danger:#ef4444}`,
|
`:root{--bg:${frame.background};--text:#f9fafb;--border:#94a3b8;--primary:#0ea5e9;--danger:#ef4444;--ring:#22c55e;--ring-offset:2px;--disabled-bg:#e5e7eb;--disabled-fg:#9ca3af}`,
|
||||||
`[data-theme="light"]{--bg:#ffffff;--text:#0f172a;--border:#cbd5e1;--primary:#0ea5e9;--danger:#ef4444}`,
|
`[data-theme="light"]{--bg:#ffffff;--text:#0f172a;--border:#cbd5e1;--primary:#0ea5e9;--danger:#ef4444;--ring:#22c55e;--ring-offset:2px;--disabled-bg:#e5e7eb;--disabled-fg:#6b7280}`,
|
||||||
`[data-theme="dark"]{--bg:#111111;--text:#f9fafb;--border:#94a3b8;--primary:#0ea5e9;--danger:#ef4444}`,
|
`[data-theme="dark"]{--bg:#111111;--text:#f9fafb;--border:#94a3b8;--primary:#0ea5e9;--danger:#ef4444;--ring:#22c55e;--ring-offset:2px;--disabled-bg:#1f2937;--disabled-fg:#9ca3af}`,
|
||||||
`.frame{position:relative;width:${frame.width}px;height:${frame.height}px;background:var(--bg)}`,
|
`.frame{position:relative;width:${frame.width}px;height:${frame.height}px;background:var(--bg)}`,
|
||||||
`.frame-scale{transform-origin:0 0}`,
|
`.frame-scale{transform-origin:0 0}`,
|
||||||
`a{color:var(--primary);text-decoration:none}`,
|
`a{color:var(--primary);text-decoration:none}`,
|
||||||
`input,select,textarea{color:var(--text);background:transparent;border:1px solid var(--border)}`,
|
`input,select,textarea{color:var(--text);background:transparent;border:1px solid var(--border)}`,
|
||||||
|
`:focus-visible{outline:2px solid var(--ring);outline-offset:var(--ring-offset)}`,
|
||||||
`input:focus,select:focus,textarea:focus{outline:2px solid var(--primary);outline-offset:2px}`,
|
`input:focus,select:focus,textarea:focus{outline:2px solid var(--primary);outline-offset:2px}`,
|
||||||
`input:invalid,select:invalid,textarea:invalid{border-color:var(--danger)}`,
|
`input:invalid,select:invalid,textarea:invalid{border-color:var(--danger)}`,
|
||||||
|
`input:disabled,select:disabled,textarea:disabled{background:var(--disabled-bg);color:var(--disabled-fg)}`,
|
||||||
|
`input[readonly],select[readonly],textarea[readonly]{color:var(--disabled-fg)}`,
|
||||||
`fieldset{border:1px solid var(--border)}`,
|
`fieldset{border:1px solid var(--border)}`,
|
||||||
`legend{color:var(--text)}`,
|
`legend{color:var(--text)}`,
|
||||||
...piecesCss,
|
...piecesCss,
|
||||||
|
|||||||
Reference in New Issue
Block a user