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

unable to interpolate ${prop('__')} #71

Open
Tycholiz opened this issue Sep 12, 2019 · 1 comment
Open

unable to interpolate ${prop('__')} #71

Tycholiz opened this issue Sep 12, 2019 · 1 comment

Comments

@Tycholiz
Copy link

Trying to make an Icon component a little more modular by allowing a prop for palette level to be passed. Here is the original:

  color: ${ifProp('palette', palette({ grayscale: 0 }, 3), 'currentcolor')};

and here is what I am trying to change it to:

  color: ${ifProp('palette', palette({ grayscale: 0 }, **prop('paletteLevel')**), 'currentcolor')};

however this doesn't work for me. Should the function prop('paletteLevel') not evaluate to the prop I pass in (2 in this case)?

@diegohaz
Copy link
Owner

Hi @Tycholiz! Palette currently doesn't support passion tone/defaultValue as functions (the function returned by prop for example). But I'd accept a PR adding that.

Just make sure you're using styled-tools (your code example seems to use styled-theme, and the API is slightly different).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants