fix(lynx-css): refresh text color on theme change#1653
Conversation
🦋 Changeset detectedLatest commit: c69e305 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughtext 요소의 배경색에 변경 사항Lynx 텍스트 요소 테마 전환 수정
예상 코드 리뷰 노력🎯 2 (단순) | ⏱️ ~10분 시
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Lynx does not re-resolve inline-style var() when the theme changes
(only rule-based var() is tracked for style invalidation), so <text>
color set via an inline var() stays stale after a theme switch. Add a
global `text { background-color: var(--seed-color-bg-transparent) }`
rule whose rule-based var() recalculation forces an element re-paint
that also refreshes the inline color. bg-transparent has alpha 0 in
both themes, so there is no visual side effect.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
bac557f to
c122faf
Compare
# Conflicts: # packages/lynx-css/all.min.css
Alpha Preview (Stackflow SPA)
|
Alpha Preview (Storybook)
|
Alpha Preview (Docs)
|
요약
Lynx에서 테마(라이트↔다크) 전환 시
<text>의 color가 이전 테마 색으로 남아 갱신되지 않던 버그를 수정합니다.근본 원인
Text는 color를 inline style의var()로 겁니다 (handleColor→vars.$color.fg.neutral === "var(--seed-color-fg-neutral)").var()만 invalidation을 추적하고, inline style의var()는 재계산하지 않습니다 (enableCSSInlineVariables: true도 초기 resolve만 수행).--seed-color-fg-neutral값이 바뀌어도<text>의 inline color가 갱신되지 않습니다. (반면ThemingPage의text-fg-*class color는 정상 갱신 — 방증)변경 사항
packages/lynx-qvism-preset/src/global.ts에 글로벌 규칙을 추가하고bun qvism:generate로lynx-css/base.css·all.css를 재생성합니다:var()가 테마 전환 시 재계산되며 element re-paint를 유발 → 같은<text>의 inline color까지 함께 갱신됩니다.--seed-color-bg-transparent는 light#0000/ dark#fff0로 alpha=0(시각적 무해)이지만 RGB가 달라서 트리거됩니다.메커니즘은 Lynx 엔진 코드로 거의 확정했으나, 실동작은 시뮬레이터/실기기 확인이 필요합니다:
examples/lynx-spa에서Text컴포넌트(inline color)가 테마 전환 시 즉시 갱신되는지useTextColor훅) 검토범위 밖
var()→ class 기반으로 전환)은 범위가 커서 별도 과제로 분리합니다.useIconColor)은<image>의tint-colorattribute 문제로 메커니즘이 달라 그대로 유지합니다.🤖 Generated with Claude Code
Summary by CodeRabbit
버그 수정
Chore