Skip to content

Commit bac557f

Browse files
junghyeonsuclaude
andcommitted
fix(lynx-css): refresh text color on theme change
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>
1 parent 4e2ee69 commit bac557f

6 files changed

Lines changed: 26 additions & 2 deletions

File tree

.changeset/swift-pandas-grin.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@seed-design/lynx-css": patch
3+
---
4+
5+
Lynx에서 테마(라이트/다크) 전환 시 텍스트 색상이 갱신되지 않던 문제를 수정합니다.

packages/lynx-css/all.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
text {
2+
background-color: var(--seed-color-bg-transparent);
3+
}
4+
15
.seed-icon, .seed-prefix-icon, .seed-suffix-icon {
26
flex-shrink: 0;
37
justify-content: center;

packages/lynx-css/all.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/lynx-css/base.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
text {
2+
background-color: var(--seed-color-bg-transparent);
3+
}
4+
15
.seed-icon, .seed-prefix-icon, .seed-suffix-icon {
26
flex-shrink: 0;
37
justify-content: center;

packages/lynx-css/base.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/lynx-qvism-preset/src/global.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
import { defineGlobalCss } from "./utils/define";
22

33
export const globalCss = defineGlobalCss({
4+
// Lynx theme color update workaround.
5+
// SEED <text> renders `color` via an inline-style var(), but the Lynx engine does
6+
// not re-resolve inline var() when the theme changes — only rule-based var() is
7+
// tracked for style invalidation. Setting a theme-dependent transparent background
8+
// (--seed-color-bg-transparent: light #0000 / dark #fff0) through a type selector
9+
// (a CSS rule) forces an element re-paint on theme change, which also refreshes the
10+
// inline `color`. alpha is 0 in both themes, so there is no visual side effect.
11+
// ⚠️ Do NOT set background-color on <text> elsewhere — use class-based styling.
12+
text: {
13+
backgroundColor: "var(--seed-color-bg-transparent)",
14+
},
415
".seed-icon, .seed-prefix-icon, .seed-suffix-icon": {
516
display: "flex",
617
alignItems: "center",

0 commit comments

Comments
 (0)