Skip to content
This repository was archived by the owner on Jun 7, 2024. It is now read-only.
This repository was archived by the owner on Jun 7, 2024. It is now read-only.

Ability to use prop values in mapToTheme #17

@mmartinsky

Description

@mmartinsky

I think it's similar to #8 , but it would be nice to be able to use the prop value rather than just prop key in mapToTheme.

So mapToTheme would become something like:

export const mapToTheme = (themeKey, propValue) => 

Ideal Example:

const theme = {
    color: {
        primary: '#086ea1',
        success: '#178c5b',
        warning: '#D9822B',
        danger: '#DB3737',
    },
};

const StyledButton = styled.button`
    color: ${mapToTheme('color', 'kind')};
`}

<Button kind='success' />

I'd be happy to submit a PR if you agree this would be helpful

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions