Skip to content

Conversation

@mellyeliu
Copy link
Member

@mellyeliu mellyeliu commented Jan 31, 2026

Context

This is an interim fix for #1473 to unblock some internal experiments. The larger bug requires a better solution at the API design level.

We currently enforce outer-key pseudo-elements, which by our sorting logic outputs

.x1qdmp1q::before:hover{color:red}

In the meantime, let's allow for compound selectors like :hover::after and sum up the priorities. We'll opt out of handling functional pseudo-classes (eg. :where(), :is(), :has()), as those don't follow additive specificities.

This PR is a follow up to ca12618 to clean up failing signals and refine logic

move compound pseudo selector handling to a single location in
getPriority() instead of duplicating in getPseudoElementPriority()
and getPseudoClassPriority().
@vercel
Copy link

vercel bot commented Jan 31, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
stylex Ready Ready Preview, Comment Jan 31, 2026 2:35pm

Request Review

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jan 31, 2026
@github-actions
Copy link

workflow: benchmarks/perf

Comparison of performance test results, measured in operations per second. Larger is better.
yarn workspace v1.22.22
yarn run v1.22.22
$ node ./compare.js /tmp/tmp.T9ZOHzST1T /tmp/tmp.0gZa15adOB

Results Base Patch Ratio
babel-plugin: stylex.create
· basic create 543 536 0.99 -
· complex create 68 67 0.99 -
babel-plugin: stylex.createTheme
· basic themes 442 435 0.98 -
· complex themes 35 33 0.94 !!
Done in 0.07s.
Done in 0.31s.

@github-actions
Copy link

workflow: benchmarks/size

Comparison of minified (terser) and compressed (brotli) size results, measured in bytes. Smaller is better.
yarn workspace v1.22.22
yarn run v1.22.22
$ node ./compare.js /tmp/tmp.s8QvIQENB6 /tmp/tmp.qazKJrT2R0

Results Base Patch Ratio
@stylexjs/stylex/lib/cjs/stylex.js
· compressed 1,311 1,311 1.00
· minified 4,150 4,150 1.00
@stylexjs/stylex/lib/cjs/inject.js
· compressed 1,793 1,793 1.00
· minified 4,915 4,915 1.00
benchmarks/size/.build/bundle.js
· compressed 496,650 496,650 1.00
· minified 4,847,840 4,847,840 1.00
benchmarks/size/.build/stylex.css
· compressed 99,867 99,867 1.00
· minified 747,613 747,613 1.00
Done in 0.07s.
Done in 0.32s.

@mellyeliu mellyeliu merged commit 560dd8b into main Jan 31, 2026
10 checks passed
@mellyeliu mellyeliu deleted the fix-compound branch January 31, 2026 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants