Skip to content

Conversation

@jonavila
Copy link

This PR attempts to revive the work done @phelma (https://github.com/phelma) in #174. I took his work and put in the core package and update the SxStyleProp type.

Sorry about the noise added by Prettier in the test file.

return theme => {
const styles = css(props.sx)(theme)
const sx = Array.isArray(props.sx) ? props.sx : [props.sx]
const styles = sx.map(s => css(s)(theme))
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jxnblk Do you have a preferred method for recursively flattening arrays? I realized after I opened the PR that Emotion recursively flattens arrays of styles and this doesn't account for that scenario.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are merge utilities in this file (see line 66)—is that what you’re looking for?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lachlanjc Thanks for the suggestion. Looks like the merge utility didn't have what i was looking for. I update a PR to do the flattening though.

@dburles dburles mentioned this pull request May 11, 2020
7 tasks
@lachlanjc lachlanjc added the enhancement New feature or request label Dec 3, 2020
@hasparus hasparus closed this Dec 14, 2020
@hasparus hasparus deleted the branch system-ui:develop December 14, 2020 08:53
@hasparus hasparus reopened this Dec 14, 2020
@vercel
Copy link

vercel bot commented Dec 14, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/systemui/theme-ui/gvd2e4iv4
✅ Preview: https://theme-ui-git-sx-composition.systemui.vercel.app

@hasparus hasparus changed the base branch from master to develop December 14, 2020 09:13
@hasparus hasparus self-requested a review as a code owner December 14, 2020 09:13
@jonavila jonavila closed this Feb 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants