Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- remove no-longer-needed `tailwind.config.js` (https://tailwindcss.com/blog/tailwindcss-v4#css-first-configuration)
- drop now outdated `esbuild-plugin-tailwindcss` and inline a tiny implementation of a tailwind esbuild plugin
-  updated screenshots to include new versions

https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.0.0
https://github.com/electron/electron/releases/tag/v34.0.1
  • Loading branch information
AviVahl committed Jan 23, 2025
1 parent 060b188 commit b2f17eb
Show file tree
Hide file tree
Showing 9 changed files with 614 additions and 988 deletions.
Binary file modified docs/screenshot-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshot-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,552 changes: 581 additions & 971 deletions package-lock.json

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,23 @@
},
"devDependencies": {
"@heroicons/react": "^2.2.0",
"@tailwindcss/postcss": "^4.0.0",
"@types/node": "20",
"@types/react": "^19.0.7",
"@types/react-dom": "^19.0.3",
"electron": "^34.0.0",
"electron": "^34.0.1",
"electron-builder": "^25.1.8",
"esbuild": "^0.24.2",
"esbuild-plugin-tailwindcss": "^1.2.1",
"eslint": "^9.18.0",
"eslint-config-prettier": "^10.0.1",
"eslint-plugin-react": "^7.37.4",
"eslint-plugin-react-hooks": "^5.1.0",
"playwright": "^1.49.1",
"postcss": "^8.5.1",
"prettier": "^3.4.2",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"tailwindcss": "^3.4.17",
"tailwindcss": "^4.0.0",
"typescript": "~5.7.3",
"typescript-eslint": "^8.21.0"
},
Expand Down
4 changes: 2 additions & 2 deletions scripts/build.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// @ts-check

import { build, context } from "esbuild";
import { tailwindPlugin } from "esbuild-plugin-tailwindcss";
import fs from "node:fs/promises";
import { tailwindEsbuildPlugin } from "./tailwind-esbuild-plugin.js";

const isWatch = process.argv.includes("--watch") || process.argv.includes("-w");
const outPath = new URL("../dist/", import.meta.url);
Expand Down Expand Up @@ -50,7 +50,7 @@ const browserEsmBundle = {
...commonBuildOptions,
format: "esm",
entryPoints: ["src/renderer.tsx"],
plugins: [tailwindPlugin()],
plugins: [tailwindEsbuildPlugin],
};

/** @type {import('esbuild').BuildOptions} */
Expand Down
4 changes: 3 additions & 1 deletion scripts/generate-screenshots.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// @ts-check

import { fileURLToPath } from "node:url";
import { _electron as electron } from "playwright";

for (const colorScheme of ["light", "dark"]) {
for (const colorScheme of /** @type {const} */ (["light", "dark"])) {
const app = await electron.launch({ args: ["."], colorScheme });
const window = await app.firstWindow();
await window.screenshot({
Expand Down
23 changes: 23 additions & 0 deletions scripts/tailwind-esbuild-plugin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// @ts-check

import fs from "node:fs/promises";
import tailwindPostcss from "@tailwindcss/postcss";
import postcss from "postcss";

/** @type {import("esbuild").Plugin} */
export const tailwindEsbuildPlugin = {
name: "tailwind-esbuild-plugin",
setup(build) {
build.onLoad({ filter: /\.css$/ }, async (args) => {
const result = await postcss([tailwindPostcss]).process(await fs.readFile(args.path, "utf8"), {
from: args.path,
});

return {
contents: result.css,
warnings: result.warnings().map((warning) => ({ pluginName: "tailwind-esbuild-plugin", text: warning.toString() })),
loader: "css",
};
});
},
};
4 changes: 1 addition & 3 deletions src/global.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
@import "tailwindcss";

:root {
@apply bg-gray-100 dark:bg-gray-800 transition-colors duration-200;
Expand Down
8 changes: 0 additions & 8 deletions tailwind.config.js

This file was deleted.

0 comments on commit b2f17eb

Please sign in to comment.