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

[Help wanted] Transform types #10

Closed
jpudysz opened this issue Oct 5, 2023 · 1 comment
Closed

[Help wanted] Transform types #10

jpudysz opened this issue Oct 5, 2023 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@jpudysz
Copy link
Owner

jpudysz commented Oct 5, 2023

Hey 👋

I have one open issue to be picked up by someone, I'm looking for typescript type that will handle following case:

const stylesheet = createStyles(theme => ({
    container: {
        flex: 1,
        justifyContent: 'center',
        alignItems: 'center',
        backgroundColor: {
            sm: theme.colors.oak,
            md: theme.colors.aloes,
            ':w[800]': theme.colors.fog
        },
        // this works ok
        transform: [
            {
                scale: 3
            }
        ],
        shadowColor: theme.colors.oak,
        shadowOffset: {
            width: 0,
            height: {
                sm: 10,
                md: 20
            }
        },
        shadowOpacity: 0.3,
        shadowRadius: 4
    }
}))

but

const stylesheet = createStyles(theme => ({
    container: {
        flex: 1,
        justifyContent: 'center',
        alignItems: 'center',
        backgroundColor: {
            sm: theme.colors.oak,
            md: theme.colors.aloes,
            ':w[800]': theme.colors.fog
        },
        // this works in JS but is rejeted by TS
        transform: [
            {
                scale: 3
            },
           {
                translateX: {
                    sm: 20,
                    md: 40
                }
            }
        ],
        shadowColor: theme.colors.oak,
        shadowOffset: {
            width: 0,
            height: {
                sm: 10,
                md: 20
            }
        },
        shadowOpacity: 0.3,
        shadowRadius: 4
    }
}))
@jpudysz jpudysz added the help wanted Extra attention is needed label Oct 5, 2023
@jpudysz
Copy link
Owner Author

jpudysz commented Oct 6, 2023

Fixed with #12

@jpudysz jpudysz closed this as completed Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant