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

Support for stores #3

Open
Kelin2025 opened this issue Jun 7, 2020 · 1 comment
Open

Support for stores #3

Kelin2025 opened this issue Jun 7, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@Kelin2025
Copy link

Kelin2025 commented Jun 7, 2020

In React we could use components props and context to create dynamic styles

const Text = styled.div`
  color: ${props => props.color}
`

In Forest we can do something with stores. Simple use case - theming

const Text = styled.div`
  color: ${theme.map(theme => theme.colors.primary)}
`

Now it sets color to [object Object]
image

@sergeysova
Copy link
Member

Can be implemented with css-vars:

const Text = styled.div`
  color: var(--text-var-theme-juas98h);
`

@sergeysova sergeysova added the enhancement New feature or request label Jul 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants