foliage icon indicating copy to clipboard operation
foliage copied to clipboard

Support for stores

Open Kelin2025 opened this issue 5 years ago • 1 comments

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

Kelin2025 avatar Jun 07 '20 07:06 Kelin2025

Can be implemented with css-vars:

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

sergeysova avatar Jul 09 '20 19:07 sergeysova