diff --git a/components/CollectionCard.tsx b/components/CollectionCard.tsx index c382f6e..02f3f34 100644 --- a/components/CollectionCard.tsx +++ b/components/CollectionCard.tsx @@ -8,7 +8,6 @@ import ProfilePhoto from "./ProfilePhoto"; import { faCalendarDays } from "@fortawesome/free-regular-svg-icons"; import useModalStore from "@/store/modals"; import usePermissions from "@/hooks/usePermissions"; -import { useTheme } from "next-themes"; type Props = { collection: CollectionIncludingMembersAndLinkCount; @@ -25,8 +24,6 @@ type DropdownTrigger = export default function CollectionCard({ collection, className }: Props) { const { setModal } = useModalStore(); - const { theme } = useTheme(); - const formattedDate = new Date(collection.createdAt as string).toLocaleString( "en-US", { @@ -45,8 +42,8 @@ export default function CollectionCard({ collection, className }: Props) {
Dark Theme
@@ -91,11 +85,8 @@ export default function Appearance() {Light Theme
diff --git a/styles/globals.css b/styles/globals.css index eaf3dbb..38abe37 100644 --- a/styles/globals.css +++ b/styles/globals.css @@ -245,13 +245,14 @@ body { .reader-view code { padding: 0.15rem 0.4rem 0.15rem 0.4rem; } -[class="dark"] .reader-view code, -[class="dark"] .reader-view pre { + +[data-theme="dark"] .reader-view code, +[data-theme="dark"] .reader-view pre { background-color: rgb(49, 49, 49); border-radius: 8px; } -[class="light"] .reader-view code, -[class="light"] .reader-view pre { +[data-theme="light"] .reader-view code, +[data-theme="light"] .reader-view pre { background-color: rgb(230, 230, 230); border-radius: 8px; } diff --git a/tailwind.config.js b/tailwind.config.js index 34690e4..796b4a4 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -1,10 +1,38 @@ /** @type {import('tailwindcss').Config} */ +const plugin = require("tailwindcss/plugin"); module.exports = { - darkMode: "class", - // daisyui: { - // themes: ["light", "dark"], - // }, + daisyui: { + themes: [ + { + light: { + primary: "#0ea5e9", + secondary: "#22d3ee", + accent: "#4f46e5", + neutral: "#6b7280", + "base-100": "#f5f5f4", + info: "#a5f3fc", + success: "#22c55e", + warning: "#facc15", + error: "#dc2626", + }, + }, + { + dark: { + primary: "#38bdf8", + secondary: "#0284c7", + accent: "#818cf8", + neutral: "#1f2937", + "base-100": "#fcfcfc", + info: "#009ee4", + success: "#00b17d", + warning: "#eac700", + error: "#f1293c", + }, + }, + ], + }, + darkMode: ["class", '[data-theme="dark"]'], content: [ "./app/**/*.{js,ts,jsx,tsx}", "./pages/**/*.{js,ts,jsx,tsx}", @@ -14,6 +42,9 @@ module.exports = { "./layouts/**/*.{js,ts,jsx,tsx}", ], plugins: [ - // require("daisyui") + require("daisyui"), + plugin(({ addVariant }) => { + addVariant("dark", '&[data-theme="dark"]'); + }), ], }; diff --git a/yarn.lock b/yarn.lock index feb1783..eec8abe 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3825,11 +3825,6 @@ next-auth@^4.22.1: preact-render-to-string "^5.1.19" uuid "^8.3.2" -next-themes@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/next-themes/-/next-themes-0.2.1.tgz#0c9f128e847979daf6c67f70b38e6b6567856e45" - integrity sha512-B+AKNfYNIzh0vqQQKqQItTS8evEouKD7H5Hj3kmuPERwddR2TxvDSFZuTj6T7Jfn1oyeUyJMydPl1Bkxkh0W7A== - next@13.4.12: version "13.4.12" resolved "https://registry.yarnpkg.com/next/-/next-13.4.12.tgz#809b21ea0aabbe88ced53252c88c4a5bd5af95df"