Skip to content

Commit

Permalink
Limit colors and re-use tailwind config in desktop
Browse files Browse the repository at this point in the history
  • Loading branch information
ikatson committed Dec 16, 2023
1 parent d8c356a commit 98ce040
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 22 deletions.
2 changes: 2 additions & 0 deletions crates/librqbit/webui/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ node_modules
dist-ssr
*.local

dist/

# Editor directories and files
.vscode/*
!.vscode/extensions.json
Expand Down
2 changes: 1 addition & 1 deletion crates/librqbit/webui/dist/assets/index.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion crates/librqbit/webui/dist/assets/index.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions crates/librqbit/webui/dist/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"src": "assets/logo.svg"
},
"index.css": {
"file": "assets/index-8d563632.css",
"file": "assets/index-54ac219d.css",
"src": "index.css"
},
"index.html": {
"css": [
"assets/index-8d563632.css"
"assets/index-54ac219d.css"
],
"file": "assets/index-c39122a8.js",
"file": "assets/index-7c5fc47e.js",
"isEntry": true,
"src": "index.html"
}
Expand Down
2 changes: 1 addition & 1 deletion crates/librqbit/webui/src/components/modal/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const Modal: React.FC<ModalProps> = ({
className="fixed z-[301] top-0 left-0 w-full h-full block overflow-x-hidden overflow-y-auto"
>
<div
className={`bg-white shadow-lg my-8 mx-auto max-w-2xl rounded ${className} dark:bg-slate-800 dark:text-zinc-50`}
className={`bg-white shadow-lg my-8 mx-auto max-w-2xl rounded ${className} dark:bg-slate-800 dark:text-gray-50`}
>
<ModalHeader onClose={onClose} title={title} />
{children}
Expand Down
2 changes: 1 addition & 1 deletion crates/librqbit/webui/src/rqbit-web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const RqbitWebUI = (props: {

return (
<AppContext.Provider value={context}>
<div className="dark:bg-gray-900 dark:text-zinc-50 min-h-screen">
<div className="dark:bg-gray-900 dark:text-gray-200 min-h-screen">
<Header title={props.title} />
<div className="relative">
{/* Menu buttons */}
Expand Down
5 changes: 0 additions & 5 deletions crates/librqbit/webui/tailwind.config.js

This file was deleted.

21 changes: 21 additions & 0 deletions crates/librqbit/webui/tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import colors from "tailwindcss/colors";

import type { Config } from "tailwindcss";

export default {
content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
darkMode: "class",
theme: {
colors: {
transparent: colors.transparent,
amber: colors.amber,
black: colors.black,
blue: colors.blue,
slate: colors.slate,
white: colors.white,
gray: colors.gray,
green: colors.green,
red: colors.red,
},
},
} satisfies Config;
4 changes: 2 additions & 2 deletions desktop/src-tauri/Cargo.lock

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

8 changes: 0 additions & 8 deletions desktop/tailwind.config.js

This file was deleted.

11 changes: 11 additions & 0 deletions desktop/tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import rqbitWebTailwind from "../crates/librqbit/webui/tailwind.config";

import type { Config } from "tailwindcss";

export default {
...rqbitWebTailwind,
content: [
"./src/**/*.{js,ts,jsx,tsx,mdx}",
"../crates/librqbit/webui/src/**/*.{js,ts,jsx,tsx,mdx}",
],
} satisfies Config;

0 comments on commit 98ce040

Please sign in to comment.