Skip to content
Open
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions partykit.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
"react": "@preact/compat",
"react-dom": "@preact/compat"
},
"loaders": {
".module.css": "local-css"
},
"outdir": "public",
"format": "iife",
"splitting": false
Expand Down
5 changes: 5 additions & 0 deletions public/cursors.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions public/cursors.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions src/cursors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@ import { render } from "react-dom";
import PresenceProvider from "./presence/presence-context";
import Cursors from "./presence/Cursors";

// @ts-ignore
import classes from "./styles.module.css";

// declare everything imported from *.module.css to be strings

// // This doesn't appear to work right now, hence the @ts-ignore up there
// declare module "*.module.css" {
// const classes: { [key: string]: string };
// export default classes;
// }

console.log(classes);

declare const PARTYKIT_HOST: string;

const pageId = window?.location.href
Expand All @@ -19,6 +32,7 @@ function App() {
color: "#0000f0",
}}
>
<div className={classes.x}>Test CSS modules (should have red border)</div>
<Cursors />
</PresenceProvider>
);
Expand Down
3 changes: 3 additions & 0 deletions src/styles.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.x {
border: 1px solid red;
}