Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle derived sx in Flex.tsx #2535

Merged
merged 1 commit into from
Feb 14, 2025

Conversation

rtturner
Copy link
Contributor

Reported this issue #2534

Derived styles are not applied to Flex as it is spread (assumed to be an object?)

Handling the instance where passed sx is a function applies styles appropriately

// This does not work currently
<Flex sx={() => ({ backgroundColor: "red" })} />

// However, this does work
<Box sx={() => ({ backgroundColor: "red" })} />

Wanted to provide a PR along with issue.

Copy link

vercel bot commented Feb 12, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
theme-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 12, 2025 3:58pm

Copy link

codesandbox-ci bot commented Feb 12, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 93ce9f6:

Sandbox Source
next-theme-ui-example Configuration
gatsby-plugin-theme-ui-example Configuration

@hasparus
Copy link
Member

Thank you for the PR!

@hasparus hasparus merged commit 99ce873 into system-ui:develop Feb 14, 2025
8 of 9 checks passed
hasparus added a commit that referenced this pull request Feb 14, 2025
@hasparus hasparus added the prerelease This change is available in a prerelease. label Feb 14, 2025
@hasparus
Copy link
Member

🚀 PR was released in v0.17.2 🚀

@hasparus hasparus added released This issue/pull request has been released. and removed prerelease This change is available in a prerelease. labels Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants