Repository navigation
Conversation
Atomic rules of one selector and breakpoint were sorted by property name, so `border-width` came after `border-top-width` and `place-items` after `align-items`, and the shorthand won. StyleX's default property-specificity policy, and atomic CSS generally, let a longhand win regardless of order. css::property_order lists each CSS shorthand and the properties it sets. A property sorts under the greatest name among itself and its covering shorthands, then by how deeply it is covered, so it lands right after its last shorthand while unrelated properties keep their alphabetical order. `all` sorts first. The sheet uses this order for class and at-rule declarations of every source, not only StyleX. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Now that the sheet writes a longhand after every shorthand covering it,
`css({ borderTopWidth: 2, borderWidth: 1 })` let the earlier longhand win.
A shorthand written later drops the earlier longhand's atom instead, so it
wins by construction whatever the sheet order:
- `css::property_order::covers` reads the shorthand table transitively.
- A style object's declarations (css(), styled objects, nested selectors)
and Box attributes drop a longhand a later declaration's shorthand covers.
- css() composition drops it when a later part sets the shorthand.
Only static, unconditional atoms at the same selector, breakpoint, layer
and style order are dropped; conditional or dynamic values keep both, and
global rules keep their declarations in the order written.
Refs #688
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 15, 2026
No conflicts. main's sheet changes (rm_file and the stylesheet stack from #951) merge beside the property_order sort in prop_cmp; the css, sheet, binding-core, wasm and extractor tests pass unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-wins No conflicts. Brings in main through #974's merge; the shorthand composition in the extractor merges beside main's stylesheet stack and removeFile changes, and the css, sheet, extractor, binding-core and wasm tests pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
owjs3901
added a commit
that referenced
this pull request
Nov 16, 2026
Brings in main through #974 and #978. In the vite, rsbuild, webpack and bun plugins, the setupWarning (#945) imports and main's createNodeModulesExcludeRegex sit beside normalizeStylexOptions, and styleResolution is still set next to registerShorthands wherever main configures the engine. The ABI now has 31 names: main's removeFile plus setStylexStyleResolution. Updated the count in script.js, the consumer, the native README and typings, and compiler-types (30 without Output). Validation covers 47 positions in 20 functions (276 cases), and the summary reports 20 functions. The e2e host lists both names and counts 27 corpus scenarios. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…overs The lint sorts JSX attributes by name (perfectionist/sort-jsx-props), so their order is not the order the author chose: `backgroundClip` always comes before `bg`. Treating it as written order dropped the `background-clip: text` atom of `<Text backgroundClip="text" bg="linear-gradient(...)" />`, which broke the gradient text of the landing DevupUICard and its mobile benchmark screenshot. Attributes between two spreads now replace none of each other's longhands, and the sheet order (a longhand after its shorthands) decides as in #974. A spread keeps its place: a shorthand in a later spread or in the attributes after a spread still replaces an earlier longhand. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
#974 landed on main as a squash, so its files came in as add/add conflicts. property_order.rs keeps this branch's version (#974's table plus covers()); sheet/lib.rs keeps main (with #961's token tests) and only re-sorts the Box test props. extract_style_from_expression.rs imports both main's descendants and this branch's LaterDeclarations. The style_results_read_as_values snapshot takes main's __devupStyled wrapper (#958) on top of this branch's dropped animation-name atoms. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pick up the #983 snapshot fix so CI runs against current main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Drops an earlier longhand atom at the composition stage so that a later shorthand beats an earlier longhand (#688).
Problem
css({ borderTopWidth: 2, borderWidth: 1 })the earlierborder-top-widthwon. That doesn't match [전수조사/A] 조합 우선순위: 뒤에 쓴 스타일이 이기게 (빌드 타임 정적 해결) #688's "the later style wins".Change
css::property_order::covers(shorthand, property). It reads fix(sheet): write a longhand after every shorthand that covers it #974's shorthand table transitively. E.g.bordercoversborder-top-width.extractor::composition::shorthandscss()objects,styledobjects: the root object ofextract_projected_hovercss()multi-argument composition:Composition::overlay. This is the existing "later argument wins" path.JSX prop order is not treated as "authoring order"
Lint (
perfectionist/sort-jsx-props) enforces alphabetical JSX props, so the order between props is not one the author chose. Applying the rule as-is makes gradient text like<Text backgroundClip="text" bg="linear-gradient(...)">losebackground-cliptobackground(confirmed by a screenshot regression in the landingDevupUICard). So props within the same spread segment are both kept, and #974's sheet order (longhand later) decides. Spread positions reflect authoring intent, so they are treated as boundaries.Conditions for dropping (conservative)
An earlier longhand atom is dropped only when all of the following hold.
In these cases both are kept and the sheet order (longhand later) decides.
on ? 1 : 3, the conditional side ofcss(a, cond && b)borderTopWidth: [2, 3]is kept.globalCss/<Global>write declarations into one rule in the order written, so the later declaration already wins. So nothing is dropped there (same policy as #974).Output changes
test_style_results_read_as_valuessnapshotcss({ animationName, animation })and<Box animationName {...{ animation }} />, the earlieranimation-nameatom is dropped.static_numbers_when_css_prop_expands_keep_shorthands_and_unitless_values:mxcame beforemargin, somargin-leftwas dropped. To keep the test's purpose (checking thatmxnumbers become px), the order was changed tomargin,mx.extracted_longhands_win_over_shorthandsBox case is left as is (with sorted Box props, the longhand wins).Test plan
composition_shorthand_tests(20 cases)css()objects, transitive (border),place-items,styleOrder, nested_hovercss(b, {...})composition_hoverstyled.div,styled('div')backgroundClip+bggradient text)globalCsscss::property_order::covers_what_a_shorthand_setscargo test -p extractor -p css -p sheet -p devup-ui-binding-core -p devup-ui-wasm --tests -j 2passescargo clippy -p extractor -p css -p sheet --all-targets -- -D warnings,cargo fmt --all요약
뒤에 쓴 shorthand가 앞에 쓴 longhand를 이기도록(#688) 조합 단계에서 앞의 longhand atom을 뺍니다.
문제
css({ borderTopWidth: 2, borderWidth: 1 })에서 앞에 쓴border-top-width가 이겼습니다. #688의 "뒤에 쓴 스타일이 이긴다"와 맞지 않습니다.변경
css::property_order::covers(shorthand, property)를 추가했습니다. #974의 shorthand 표를 전이적으로 읽습니다. 예:border는border-top-width를 덮습니다.extractor::composition::shorthandscss()객체,styled객체:extract_projected의 루트 객체_hover같은 중첩 selector 객체css()다중 인자 조합:Composition::overlay. 기존 "later argument wins" 경로입니다.JSX 속성 순서는 "작성 순서"로 보지 않음
lint(
perfectionist/sort-jsx-props)가 JSX 속성을 이름순으로 강제하므로, 속성 사이의 순서는 작성자가 고른 순서가 아닙니다. 그대로 적용하면<Text backgroundClip="text" bg="linear-gradient(...)">같은 gradient text가background에background-clip을 잃습니다(랜딩DevupUICard스크린샷 회귀로 확인). 그래서 같은 spread 구간의 속성끼리는 둘 다 남기고 #974의 sheet 순서(longhand가 뒤)가 결정합니다. spread 위치는 작성 의도이므로 경계로 봅니다.빼는 조건 (보수적)
다음을 모두 만족할 때만 앞의 longhand atom을 뺍니다.
다음 경우에는 둘 다 남기고 sheet 순서(longhand가 뒤)가 결정합니다.
on ? 1 : 3,css(a, cond && b)의 조건 쪽borderTopWidth: [2, 3]의 1번 breakpoint는 남습니다.globalCss/<Global>은 선언을 쓴 순서대로 한 규칙에 쓰므로 이미 뒤의 선언이 이깁니다. 그래서 빼지 않습니다(#974와 같은 방침).출력 변화
test_style_results_read_as_values스냅샷css({ animationName, animation })과<Box animationName {...{ animation }} />에서 앞의animation-nameatom이 빠졌습니다.static_numbers_when_css_prop_expands_keep_shorthands_and_unitless_values:mx가margin보다 앞에 있어서margin-left가 빠졌습니다. 테스트의 목적(mx숫자를 px로 바꾸는지 확인)을 유지하려고margin,mx순서로 바꿨습니다.extracted_longhands_win_over_shorthandsBox 케이스는 원래대로 둡니다(정렬된 Box 속성에서는 longhand가 이김).테스트 계획
composition_shorthand_tests(20 cases)css()객체, 전이(border),place-items,styleOrder, 중첩_hovercss(b, {...})조합_hoverstyled.div,styled('div')backgroundClip+bggradient text 포함)globalCsscss::property_order::covers_what_a_shorthand_setscargo test -p extractor -p css -p sheet -p devup-ui-binding-core -p devup-ui-wasm --tests -j 2통과cargo clippy -p extractor -p css -p sheet --all-targets -- -D warnings,cargo fmt --allRefs #688
Refs #690
🤖 Generated with Claude Code