Skip to content

Commit

Permalink
chore: add vanilla extract
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaKGoldberg committed Feb 20, 2024
1 parent 4d5fe66 commit a96e2cd
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 12 deletions.
10 changes: 1 addition & 9 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,6 @@ module.exports = {
"jsdoc/require-returns": "off",
},
},
{
files: "**/*.md/*.ts",
rules: {
"n/no-missing-import": [
"error",
{ allowModules: ["boston-ts-website"] },
],
},
},
{
excludedFiles: ["**/*.md/*.ts"],
extends: [
Expand Down Expand Up @@ -135,6 +126,7 @@ module.exports = {
"@typescript-eslint/no-unused-vars": ["error", { caughtErrors: "all" }],

// These on-by-default rules don't work well for this repo and we like them off.
"n/no-missing-import": "off",
"n/no-unpublished-import": "off",
"no-case-declarations": "off",
"no-constant-condition": "off",
Expand Down
7 changes: 7 additions & 0 deletions app/HeroHeading.css.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { style } from "@vanilla-extract/css";

export const root = style({
background: "white",
border: "solid 1px",
color: "#454545",
});
7 changes: 7 additions & 0 deletions app/HeroHeading.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from "react";

import * as styles from "./HeroHeading.css";

export function HeroHeading({ children }: React.PropsWithChildren) {
return <h1 className={styles.root}>{children}</h1>;
}
11 changes: 10 additions & 1 deletion app/root.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
import type { LinksFunction } from "@remix-run/node";

import { cssBundleHref } from "@remix-run/css-bundle";
import { Links, LiveReload, Meta, Outlet, Scripts } from "@remix-run/react";

import { HeroHeading } from "./HeroHeading.js";

export const links: LinksFunction = () => [
...(cssBundleHref ? [{ href: cssBundleHref, rel: "stylesheet" }] : []),
];

export default function App() {
return (
<html>
Expand All @@ -9,7 +18,7 @@ export default function App() {
<Links />
</head>
<body>
<h1>Hello world!</h1>
<HeroHeading>Hello world!</HeroHeading>
<Outlet />

<Scripts />
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@
"*": "prettier --ignore-unknown --write"
},
"dependencies": {
"@remix-run/css-bundle": "^2.6.0",
"@remix-run/dev": "^2.6.0",
"@remix-run/express": "^2.6.0",
"@remix-run/node": "^2.6.0",
"@remix-run/react": "^2.6.0",
"@vanilla-extract/css": "^1.14.1",
"express": "^4.18.2",
"isbot": "4",
"react": "^18.2.0",
Expand Down
11 changes: 11 additions & 0 deletions pnpm-lock.yaml

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

4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"esModuleInterop": true,
"isolatedModules": true,
"jsx": "react-jsx",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"module": "ESNext",
"moduleResolution": "Bundler",
"noEmit": true,
"outDir": "lib",
"paths": {
Expand Down

0 comments on commit a96e2cd

Please sign in to comment.