Skip to content

Commit d11976c

Browse files
authored
Add an example with Remix (#1317)
1 parent 69d4dc9 commit d11976c

File tree

15 files changed

+2091
-64
lines changed

15 files changed

+2091
-64
lines changed

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ site/docs-manifest.json
1111
pnpm-lock.yaml
1212
*-snapshots
1313
test-results
14+
examples/remix/build

examples/remix/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
build
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { style } from '@vanilla-extract/css';
2+
3+
export const root = style({
4+
background: 'lightcyan',
5+
color: 'oklab(59.686% 0.1009 0.1192)', // Testing Lightning CSS
6+
padding: '16px',
7+
transition: 'opacity .1s ease',
8+
':hover': {
9+
opacity: 0.8,
10+
},
11+
});
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import * as styles from './HelloWorld.css';
2+
3+
export function HelloWorld() {
4+
return (
5+
<div className={styles.root}>
6+
<h1>🧁 Hello from vanilla-extract!</h1>
7+
</div>
8+
);
9+
}

examples/remix/app/root.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { Links, Meta, Outlet, Scripts } from '@remix-run/react';
2+
3+
export default function App() {
4+
return (
5+
<html lang="en">
6+
<head>
7+
<meta charSet="utf-8" />
8+
<meta name="viewport" content="width=device-width, initial-scale=1" />
9+
<Meta />
10+
<Links />
11+
</head>
12+
<body>
13+
<Outlet />
14+
<Scripts />
15+
</body>
16+
</html>
17+
);
18+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import type { MetaFunction } from '@remix-run/node';
2+
3+
import { HelloWorld } from '../components/HelloWorld';
4+
5+
export const meta: MetaFunction = () => {
6+
return [{ title: 'Remix Example' }];
7+
};
8+
9+
export default function Index() {
10+
return <HelloWorld />;
11+
}

examples/remix/env.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/// <reference types="@remix-run/node" />
2+
/// <reference types="vite/client" />

examples/remix/package.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "vanilla-extract-example-remix",
3+
"version": "0.0.0",
4+
"private": true,
5+
"type": "module",
6+
"scripts": {
7+
"dev": "remix vite:dev",
8+
"build": "remix vite:build",
9+
"start": "remix-serve ./build/server/index.js"
10+
},
11+
"dependencies": {
12+
"@remix-run/node": "^2.6.0",
13+
"@remix-run/react": "^2.6.0",
14+
"@remix-run/serve": "^2.6.0",
15+
"@vanilla-extract/css": "*",
16+
"isbot": "^4",
17+
"react": "^18.2.0",
18+
"react-dom": "^18.2.0"
19+
},
20+
"devDependencies": {
21+
"@remix-run/dev": "^2.6.0",
22+
"@types/react": "^18.2.55",
23+
"@vanilla-extract/vite-plugin": "*",
24+
"vite": "^5.0.11"
25+
}
26+
}

examples/remix/public/favicon.ico

16.6 KB
Binary file not shown.

examples/remix/tsconfig.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"include": ["env.d.ts", "**/*.ts", "**/*.tsx"],
3+
"compilerOptions": {
4+
"lib": ["DOM", "DOM.Iterable", "ES2022"],
5+
"isolatedModules": true,
6+
"esModuleInterop": true,
7+
"jsx": "react-jsx",
8+
"module": "ESNext",
9+
"moduleResolution": "Bundler",
10+
"resolveJsonModule": true,
11+
"target": "ES2022",
12+
"strict": true,
13+
"allowJs": true,
14+
"forceConsistentCasingInFileNames": true,
15+
"baseUrl": ".",
16+
"paths": {
17+
"~/*": ["./app/*"]
18+
},
19+
20+
// Remix takes care of building everything in `remix build`.
21+
"noEmit": true
22+
}
23+
}

0 commit comments

Comments
 (0)