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

Output rp-array.json and rp-string.json #75

Open
TheJaredWilcurt opened this issue Dec 26, 2021 · 0 comments
Open

Output rp-array.json and rp-string.json #75

TheJaredWilcurt opened this issue Dec 26, 2021 · 0 comments

Comments

@TheJaredWilcurt
Copy link
Member

TheJaredWilcurt commented Dec 26, 2021

The default classMap from red-perfume-css uses arrays of atomized classes, like so:

{
  ".cat": ["rp_3", "rp_5"],
  ".dog": ["rp_0", "rp_4", "rp_8"]
}

Because a class name can contain any character (as long as it is properly escaped), splitting a string back to an array has slightly more edge cases to it than joining an array to a string. So to avoid the edge cases, we will always store the classMap as an array. However, I suspect the majority of users will prefer having the JSON already in a joined string format. So perhaps the easiest option is to just output both during the JS task.

{
  ".cat": "rp_3 rp_5",
  ".dog": "rp_0 rp_4 rp_8"
}

Related to #12

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

No branches or pull requests

1 participant