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

Improve documentation server side rendering #111

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions data/docs/server-side-rendering.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ description: How to configure server-side rendering.

You can get access to the CSS string by using the `getCssText` function. This function is made available by the `createStitches` function.

_IMPORTANT: When making components, make sure to import `styled` and other functions from `../stitches.config` instead of from `@stitches/react` inside your components. `getCssText` will only output CSS that has been created in this manner._
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A suggestion to keep a consistent UI and tone of voice:

Suggested change
_IMPORTANT: When making components, make sure to import `styled` and other functions from `../stitches.config` instead of from `@stitches/react` inside your components. `getCssText` will only output CSS that has been created in this manner._
> Note: if you've [configured](/docs/installation#import-and-use-it) Stitches, ensure to import `getCssText` from your config file.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure whether this fully covers the problem. I think the user is required to do this, it would suprise me if SSR would work if importing from @stitches/react without using config, too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you've not configured Stitches at all, it should work fine by importing directly from npm. Did you run into an issue where it didn't?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I didn't know that, but no, I haven't tried without setting up config.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha, yeah, so I think this clarifies it further. It's not perfect I agree, but we'll be making some bigger overall docs improvements!


```jsx
import { createStitches } from '@stitches/react';

Expand Down