Closed danielvaughn closed 3 years ago
Hi, I created a codesandbox and I'm unable to reproduce the issue: https://codesandbox.io/s/zealous-ptolemy-2qv7r?file=/src/App.tsx
Can you make edits to the sandbox to reproduce?
I'm also experiencing this issue. I have only just started porting some of our old components to stitches and all the theme tokens I crated in createCss
appear in the browser prefixed with their respective type (E.g. --colors-primary
and --fontSizes-body
) but the rules applied to the component don't have those prefixes (E.g. font-size: var(--body);
and background-color: var(--primary);
).
As I said I'm completely new to stitches and I'm not really sure how to reproduce this since I just followed the Getting started section of the documentation.
I'm running on linux, the stitches version is ^0.1.9 and node version is v12.7.0.
After some trial and error I've found out my problem was related with leaving the themeMap
option on my createCss
as an empty object (themeMap: {},
), after commenting out that line everything works as expected.
I'm still not entirely sure what the themeMap does I simply copied the stitches.config snipped from the docs
@Pipas hey, thanks for that, I'll update the docs to make it more clear. There's a note already but I think its probably too hidden:
This was my issue as well - looks to be resolved on my end when I merge with defaultThemeMap
. Thank you!
Bug report
Describe the bug
When using color tokens, the mapping function seems to leave out the
colors-
portion of the string, though perhaps I'm reading the documentation incorrectly.To Reproduce
Use a color token in stitches.config:
Use the
styled
function in a component. Observe that the color is not applied:const Button = () =>Hello World
const StyledButton = styled('button', { backgroundColor: '$colors-brand', })
const Button = () =>Hello World