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

add support for prop value in mapToTheme#19

Merged
scf4 merged 3 commits intoscf4:masterfrom
mmartinsky:master
May 15, 2019
Merged

add support for prop value in mapToTheme#19
scf4 merged 3 commits intoscf4:masterfrom
mmartinsky:master

Conversation

@mmartinsky
Copy link
Copy Markdown
Contributor

Closes #17

Allows users to add an optional second argument to mapToTheme, as below:

import styledMap, { mapToTheme as theme } from 'styled-map';

const myTheme = {
  buttonColor: {
    primary: 'orange',
    warning: 'red',
    info: 'blue',
    default: 'white',
  },
  ...
};

const Button = styled.button`
  color: ${theme('buttonColor', 'kind')};
`;

<Button theme={myTheme} kind='warning'>Click</Button> // will be red

@scf4
Copy link
Copy Markdown
Owner

scf4 commented May 15, 2019

Looks good — I'll review it soon, thanks!

@scf4 scf4 merged commit 040170b into scf4:master May 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ability to use prop values in mapToTheme

2 participants