Repository navigation
Open
Labels
bugSomething isn't workingSomething isn't working
Description
atomic class는 class 속성의 순서가 아니라 CSS 파일 안의 순서로 승패가 정해집니다. 그래서 css(a, b), styled(Base) 확장, attrs, vanilla-extract style([...]), StyleX props()에서 뒤에 쓴 것이 지는 경우가 있습니다. 확인 예: css(yellow, azure)와 css(azure, yellow)가 둘 다 노란색입니다.
전체 계획과 결정 사항은 추적 이슈(#682)에 있습니다. 조사 기준 커밋: 77daad74 (현재 main d0b84255).
결정에 따른 작업
- (필수) 조합하는 조각을 모두 알 수 있으면 겹치는 속성은 앞 조각의 atom을 제거(속성·selector·반응형 단계별)
- (필수) 다른 파일과
include라이브러리의 styled 정의도 모듈 해석으로 읽어 합침 - (필수) 런타임에야 합쳐지는 조합(props로 받은 className, CSS Modules 같은 외부 class, 런타임 조립 문자열)은 CSS 특성으로 문서화: 이슈 K의 "스타일 덮어쓰기 규칙"
- (필수)
@emotion/csscx(이슈 D)가 이 기능을 사용
발견 항목
심각도: P0 = 흔한 사용에서 조용히 틀리거나 크래시, P1 = 흔한 패턴이 명시적 에러로 막히거나 드물게 조용히 틀림, P2 = 드문 경우·도구/문서 불일치, P3 = 있으면 좋음.
필수 (10)
- EMO-02 (P0, WRONG) Atomic class joins violate Emotion's later-style-wins composition contract
- 근거: react-css-compose.tsx emits danger="a b", base="c", first="a b c", second="c a b", but fixed CSS
.a{color:red}.c{color:turquoise}makes both compositions turquoise; styled-extension.tsx emits Extended classesa b cbut.c{color:blue}precedes.a{color:red}, so the base stays red - 수정 방향: composition must resolve conflicting atomic declarations into order-specific winners (or synthesize an ordered composed class); never implement css-prop, cx or merge as whitespace joining
- 근거: react-css-compose.tsx emits danger="a b", base="c", first="a b c", second="c a b", but fixed CSS
- JSX-01 (P0, WRONG) JSX spread position is ignored for
classNameandstyle- 근거:
24-spread-conflicts.tsx:<Box className="direct" style={{opacity:1}} {...known}/>becomes<div {...{"className":"from-spread","style":{"opacity":.5}}} className="direct ..." style={{opacity:1}}/>; the explicit values still win although the later spread must win. Runtime spreads before and after explicit props also generate identical ordering. - 수정 방향: preserve source-order segments when reinserting generated
className/style; merge explicit props and each spread at its original point instead of always appending explicit values.
- 근거:
- NEW-01 (P0, WRONG) devup's own css(a, b): a later part does not override an earlier one
- 근거:
const yellow = css({ color: 'yellow' }); const azure = css({ color: 'azure' }); css(yellow, azure)→"a b",css(azure, yellow)→"b a", CSS.b{color:azure}.a{color:yellow}→ both render yellow - 수정 방향: compose known parts at build time per property/selector/breakpoint, dropping the earlier conflicting atom (same mechanism as EMO-02/SC-01)
- 근거:
- RT-25 (P0, WRONG) StyleX last-applied style does not win
- 근거: probe
stylex.props(base{color:red}, override{color:blue})returns both classes in application order, but emitted CSS is.color-blue{color:blue}.color-red{color:red}; equal-specificity red wins by stylesheet order.attrshas the same defect. Falsy args and longhand-over-shorthand happened to work. - 수정 방향: Compile composition to one winning class per property (including conditional branches), rather than relying on class token order.
- 근거: probe
- SC-01 (P0, WRONG) Extended styled-component overrides lose to base atomic rules
- 근거:
04-extend-basic.tsx:Basehasa(color:red),Exthasc(color:blue), but CSS is.c{color:blue}.a{color:red}while<Ext>receives both classes, so red wins.55-extend-pseudo.tsxlikewise emits.c:hover{color:blue}.a:hover{color:red}. Responsive overlap happens to pass (54-extend-responsive.tsx: base then extension inside the media block), proving semantic… - 수정 방향: Encode extension layer/order into generated rules (or increase extension specificity) so extension declarations deterministically outrank inherited declarations for base, pseudo, responsive, and nested at-rule contexts.
- 근거:
- SC-02 (P0, WRONG) Extended-component attrs apply in reverse order
- 근거:
25-attrs-extension-order.tsxtransforms outerExtto apply{type:'password'}, then invokesBase, whose own wrapper spreads{type:'text', title:'base'}over it. Finaltypeistext, and callertitle="caller"becomesbase.apply_attrsmerges correctly within one chain (extract_style_from_styled.rs:444-490), but attrs are attached independently to nested gener… - 수정 방향: Flatten inherited styled metadata/attrs into the derived component before generating one wrapper, preserving SC's inner-to-outer order.
- 근거:
- SX-01 (P0, WRONG)
propsdoes not implement last-wins merging- 근거:
props(red, blue)→className: "a b";props(blue, red)→"b a"; shared CSS is.b{color:blue}.a{color:red}, so red wins in both cases because HTML class-token order has no cascade effect. - 수정 방향: Carry property metadata through compiled style references and drop/replace earlier conflicting atoms during
props/attrsmerging, including runtime condition branches.
- 근거:
- SX-02 (P0, WRONG)
nulldoes not unset an earlier StyleX declaration- 근거:
props(styles.base, styles.reset)where reset has{color:null}becomes{className:"a"}and.a{color:red}remains active. - 수정 방향: Preserve null/unset metadata per property through
create, then have merge resolution suppress earlier classes for those properties.
- 근거:
- VE-01 (P0, WRONG) vanilla-extract composition reverses effective precedence
- 근거:
style([base, 'external', { color: 'blue' }])transforms to"a b c" + " external", but CSS is.b{color:blue}.a{color:red};style([first, second])likewise emits blue before red. Cases:ve-style-array.css.ts,ve-composition-order.css.ts. Code-read:libs/extractor/src/vanilla_extract.rs:1288-1354collects then name-sorts output. - 수정 방향: Preserve vanilla-extract's merged declaration precedence and deterministic creation order when materializing Devup atomic rules; add conflicting-property snapshots for object/class mixtures.
- 근거:
- SC-03 (P1, WRONG) attrs overwrite instead of merging
classNameandstyle- 근거:
26-attrs-class-style.tsxproduces{...__devupProps, ...{className:'from-attrs', style:{color:'green','--x':'1'}}}. CallerclassName="from-call"andstyle={{background:'black'}}disappear.64-config-chain-order.tsxhas the same caller-class loss. Generated classaremains, but SC's caller/attrs class and style composition does not. - 수정 방향: Special-case attrs
classNameas a joined class list andstyleas an object merge while retaining documented attrs precedence for colliding style keys.
- 근거:
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Activity
test(extractor): cover known style composition branches
chore: satisfy clippy assert_is_empty lint on Rust 1.99
test(extractor): cover false ?? composition branch
refactor(extractor): split coalesce check so composition lines are me…
test(extractor): restore runtime-value composition test and cover sty…
test(extractor): cover empty StyleX conditions and arrays with runtim…
fix(extractor): keep imported styled components that read their modul…
test(extractor): cover composition and styled branches reported by Linux
test(extractor): lock imported css composition precedence in both modes
test(extractor): cover imported record and array metadata boundaries
merge: update PR #707 with main and preserve inherited captures
merge: update PR #707 with latest main and exact test hotfixes
merge: refresh PR #707 with main and cover inherited render paths
fix(extractor): lift capture visitor out of generic method
45 remaining items
merge: update PR #754 with settled PR #745
test(extractor): use neutral composition regression names
test(extractor): close Linux composition coverage gaps
ci: allow 180 seconds per coverage test binary
fix(extractor): let a later css() part replace an earlier one's decla…
fix(extractor): compose styled extensions, merge attrs and let later …
fix(extractor): merge StyleX props and attrs key by key with null uns…
feat(extractor): compose styled components other modules define
fix(extractor): read constants in Emotion rules as px and compose mix…
chore(extractor): merge imported styled definitions
fix(extractor): close build-time composition and styled capture pipel…
chore(changepack): record composition and styled extraction patch
fix(extractor): resolve imported css composition chains statically
fix(extractor): compose constant objects in css tags
owjs3901 commentedon Nov 15, 2026
main(
1160bf646)에 병합된 수정을 확인해 체크리스트를 갱신했습니다. 이 이슈의 모든 ID 항목이 체크되었습니다.새로 체크한 항목 (10건 + 결정 항목 3건)
9e29139b0,libs/extractor/src/lib.rs의test_css_later_argument_wins_*)style([first, second, first])를 소스 순서대로 합성,vanilla_extract.rs의test_composition_keeps_later_declarations)cx합성에서 뒤 선언이 이김)include라이브러리의 styled 정의를 읽어 합침: feat(extractor): compose styled components other modules define #736docs/limitations/page.mdx"Where the cascade decides")@emotion/csscx가 정적 합성 사용: fix(extractor): report Emotion code left at runtime as located errors #904체크하지 않은 결정 항목: "겹치는 속성은 앞 조각의 atom을 제거". shorthand/longhand와
include()경우를 열린 PR(#974, #975, #978)이 계속 다루고 있습니다.