feat(테마): 공통 값 한 벌 · Noto Sans KR 글꼴 파일 실음 (551-1)
- ui_template_theme.css = 대시보드 값(초록 강조 #1f7a4d · 바탕 #f6f7f9 · 선 #e6e8ec · 글 #1f2328 · 둥글기 10) 밝음 · 어두움 두 블록 · 시스템 어두움 = 같은 값 - 옛 보라 이름(deep-iris · plum-velvet · royal-amethyst · mist-violet · lavender-wash) = 새 값의 별칭 · 안 쓰는 그라디언트 3 · twilight-beam · shadow-feature 지움 - 새 토큰 accent-soft · hover · surface-sunken · border-strong · primary-hover · danger-fill(#e5484d 채운 바탕) · scrim · 위험 글자 = #c0392b 그대로 - 글꼴 = --font-ui 한 토큰(--font-body · --font-display 별칭) · Inter · Britti 등 앞 이름 뺌 · ui_template/fonts/ 에 Noto Sans KR 가변 굵기 woff2 39 묶음(unicode-range) + OFL.txt · 첫 화면 = 196 KB 한 파일 - 대시보드 --b01-* = 공통 값의 별칭 · 셸 덮어쓰기 10 줄 · 셸 어두움 블록 지움(판 바탕 흰색 한 줄만 남김) - test_546: 셸 hex 단정 → theme.css 값 · 셸 별칭 단정으로(값 자리가 theme.css 로 옮겨 감) · test_551_1 새 지킴 시험 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -102,9 +102,11 @@ def test_셸_한_벌():
|
||||
assert "setDrawerSteps" not in src and "attachCollapsible" not in src, name
|
||||
assert len(src.splitlines()) <= 700, name
|
||||
css = _text(B01 / "B01_Dashboard_UI_Style_Shell.css")
|
||||
# 색 변수는 셸 안에서만 — :root 에 안 둠
|
||||
assert "--b01-accent: #1f7a4d;" in css and not re.search(r"^:root\s*\{", css, re.M)
|
||||
assert ':root[data-theme="dark"] .b01-shell {' in css
|
||||
# 색 값은 공통 값 한 벌(theme.css 밝음 · 어두움) — 셸은 별칭만 · :root · 어두움 블록 안 둠
|
||||
theme = _text(ROOT / "ui_template" / "ui_template_theme.css")
|
||||
assert "--color-accent: #1f7a4d;" in theme and "--color-accent: #3fae75;" in theme
|
||||
assert "--b01-accent: var(--color-accent);" in css and not re.search(r"^:root", css, re.M)
|
||||
assert not re.search(r"--b01-[a-z-]+:\s*#", css)
|
||||
icons = _text(ROOT / "ui_template" / "ui_template_icons.ts")
|
||||
assert "MIT License" in icons and "Paweł Kuna" in icons
|
||||
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
"""551-1 공통 값 한 벌 · 글꼴 파일 실음 — 지킴 시험."""
|
||||
|
||||
import re
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
UI = ROOT / "ui_template"
|
||||
THEME = (UI / "ui_template_theme.css").read_text(encoding="utf-8")
|
||||
FONTS = UI / "fonts"
|
||||
|
||||
|
||||
def test_글꼴_한_토큰_실은_파일():
|
||||
assert THEME.lstrip().startswith("/*") and '@import url("./fonts/noto_sans_kr.css");' in THEME
|
||||
assert THEME.index("@import") < THEME.index(":root {") # @import 는 규칙보다 앞
|
||||
assert '--font-ui: "Noto Sans KR",' in THEME
|
||||
assert "--font-body: var(--font-ui);" in THEME and "--font-display: var(--font-ui);" in THEME
|
||||
for name in ("Inter", "Britti", "Pretendard", "Plus Jakarta"):
|
||||
assert name not in THEME, name
|
||||
css = (FONTS / "noto_sans_kr.css").read_text(encoding="utf-8")
|
||||
files = re.findall(r'url\("\./(noto-sans-kr-\d+\.woff2)"\)', css)
|
||||
assert files and len(files) == css.count("@font-face")
|
||||
for f in files:
|
||||
assert (FONTS / f).stat().st_size > 1000, f
|
||||
assert css.count('font-family: "Noto Sans KR";') == len(files)
|
||||
assert css.count("unicode-range:") == len(files)
|
||||
assert "SIL OPEN FONT LICENSE Version 1.1" in (FONTS / "OFL.txt").read_text(encoding="utf-8")
|
||||
assert len(css.splitlines()) <= 700
|
||||
|
||||
|
||||
def test_옛_보라_이름은_별칭():
|
||||
root = THEME[THEME.index(":root {") :]
|
||||
root = root[: root.index("\n}\n")]
|
||||
for old, new in (
|
||||
("deep-iris", "text"),
|
||||
("plum-velvet", "text"),
|
||||
("royal-amethyst", "accent"),
|
||||
("mist-violet", "accent-soft"),
|
||||
):
|
||||
assert f"--color-{old}: var(--color-{new});" in root, old
|
||||
assert "--color-accent: #1f7a4d;" in root and "--color-danger: #c0392b;" in root
|
||||
assert "--color-danger-fill: #e5484d;" in root
|
||||
dark = THEME[THEME.index(':root[data-theme="dark"]') :]
|
||||
assert "deep-iris" not in dark and "royal-amethyst" not in dark # 어두움도 별칭으로 따라옴
|
||||
Reference in New Issue
Block a user