Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
danilowoz committed Mar 11, 2023
1 parent 13c4509 commit fe437ab
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/nextjs/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Sandpack } from "@codesandbox/sandpack-react/unstyled";
import { Sandpack } from "@codesandbox/sandpack-react";
import { githubLight, sandpackDark } from "@codesandbox/sandpack-themes";

const Home: React.FC = () => {
Expand Down
2 changes: 1 addition & 1 deletion examples/vite-react/App.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Sandpack } from "@codesandbox/sandpack-react/unstyled";
import { Sandpack } from "@codesandbox/sandpack-react";

const App = () => {
return (
Expand Down
14 changes: 11 additions & 3 deletions website/docs/src/pages/getting-started/layout.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,19 @@ For this, sandpack uses a small package called [`classer`](https://github.com/co
This pattern is compatible with most modern styling systems, including Tailwind, styled-components and emotion.
</Callout>

### TODO Bare components and remove runtime styling
### Bare components, remove runtime styling or use unstyled components

`@codesanbdox/sandpack-react` relies on [@stitches/core](https://github.com/stitchesjs/stitches) to style its component, which is almost zero-runtime CSS-in-JS framework. However, if you want to get rid of any runtime script or create your own style on top of Sandpack components, we provide a way to return bare components, which will eliminate all Sandpack CSS style.
`@codesanbdox/sandpack-react` relies on [@stitches/core](https://github.com/stitchesjs/stitches) to style its component, which is almost zero-runtime CSS-in-JS framework. However, if you want to get rid of any runtime script or create your own style on top of Sandpack components, we provide a way to return unstyled components, which will eliminate all Sandpack CSS style.

To do it, you need to pass `SANDPACK_BARE_COMPONENTS` environment variable (`NEXT_PUBLIC_SANDPACK_BARE_COMPONENTS` for Nextjs) as `true`, which will remove the Stitches dependency, its execution and return only the HTML of the components.
To do it, you need to consume the same components from the `unstyled` subfolder, which doesn't contain the Stitches dependency. For example:

```jsx
import { Sandpack } from "@codesandbox/sandpack-react/unstyled";

const App = () => {
return <Sandpack />
};
```

## Themes

Expand Down

0 comments on commit fe437ab

Please sign in to comment.