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

@stitches/stringify #477

Merged
merged 31 commits into from
Mar 20, 2021
Merged

@stitches/stringify #477

merged 31 commits into from
Mar 20, 2021

Conversation

jonathantneal
Copy link
Contributor

@jonathantneal jonathantneal commented Mar 12, 2021

Proposal

This PR would provide the stringify function from Stitches as its own package β€” @stitches/stringify.


What is the @stitches/stringify package?

Stringify converts a JavaScript object to a CSS string, optionally replacing values if a replacer function is specified.

This function is a mirror of theΒ JSON.stringifyΒ function, only instead for generating CSS.


Why a @stitches/stringify package?

Stitches includes a very small, highly effective, performant CSS serializer capable of producing nearly-if-not-all forms of CSS. Unfortunately, the browser does not provide such functionality, and there is no other package yet that can stringify JavaScript objects into this many forms of CSS, and not while also downsampling complex nesting with a high level of accuracy. As a package that does all of this in under 1kB, such functionality may be useful to more developers and in more situations than Stitches can intend to provide. This may include runtime-specific CSS libraries, CSSOM enhancements, Node serializers, packaged components, etc.

Therefore, separating this package may provide us an opportunity to strengthen a core component within stitches while also helping move the web forward in many new ways.

@jonathantneal jonathantneal marked this pull request as draft March 12, 2021 01:11
@codesandbox-ci
Copy link

codesandbox-ci bot commented Mar 12, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 174fa57:

Sandbox Source
Stitches CI: CRA Configuration
Stitches CI: Next.js Configuration
stitches util object bug Issue #466

@jonathantneal jonathantneal changed the title feat: stringify package @stitches/stringify Mar 12, 2021
@jonathantneal jonathantneal force-pushed the jn.stringify branch 5 times, most recently from 83c460e to 2615826 Compare March 12, 2021 02:54
@jonathantneal jonathantneal marked this pull request as ready for review March 19, 2021 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants