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

Nested calls doesn't return the value #37

Open
lucasfloriani opened this issue May 24, 2019 · 1 comment
Open

Nested calls doesn't return the value #37

lucasfloriani opened this issue May 24, 2019 · 1 comment

Comments

@lucasfloriani
Copy link

When I use one function inside another the font size doesn't return properly:

font-size: ${size(prop('fontSize'))};

But when I use only one of the functions the return is correct:

font-size: ${({ fontSize }) => key(['sizes', fontSize])};

This is the intended way to use the lib or its some kind of bug? I analyzed the return from prop function and see that is a function, can this be the problem that can't be used in nested calls?

@Keemluvr
Copy link

Keemluvr commented Mar 1, 2022

I had the same problem.
for those who have the same, it is possible to get the theme by props:

font-size: ${({ fontSize, theme }) => theme[pathToVariable] )};

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

No branches or pull requests

2 participants