Skip to content
Discussion options

You must be logged in to vote

Judging by your example, I think there's a bit of confusion about how Sprinkles works. Sprinkles generates an atomic class for each combination of key/value and condition. You can't generate responsive combinations up front—by design, since this is an atomic framework.

So, your example should be configured like this:

const colorStyles = createAtomicStyles({
  conditions: {
    lightMode: {},
    darkMode: { '@media': '(prefers-color-scheme: dark)' }
  },
  defaultCondition: 'lightMode',
  responsiveArray: ['lightMode', 'darkMode'],
  properties: {
    color: ['red', 'blue', 'green', 'orange', 'purple'],
  }
});

Note that the primary key was removed. I've also added more color values to ma…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@graup
Comment options

graup Jul 28, 2021
Collaborator Author

Answer selected by graup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants