diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index fe4e968..5e1457c 100644 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -12,9 +12,9 @@ sed -i -e 's/(PAGEICON = ")\/logo\.png(")/'"$1${LOGO}$2"'/g' /app/src/variables. sed -i -e 's/(SHOWHEADER = )true/'"$1${HEADER}"'/g' /app/src/variables.ts sed -i -e 's/(SHOWHEADERLINE = )true/'"$1${HEADERLINE}"'/g' /app/src/variables.ts sed -i -e 's/(CATEGORIES = ")normal(")/'"$1${CATEGORIES}$2"'/g' /app/src/variables.ts +sed -i -e 's/(THEME = ")light(")/'"$1${THEME}$2"'/g' /app/src/variables.ts # CSS replacement -sed -i -e 's/(background-color: )#f8fafc/'"$1${BGCOLOR}"'/g' /app/src/tailwind.css - #f8fafc +sed -i -e 's/(background-color: )theme\(colors\.slate\.50\)/'"$1${BGCOLOR}"'/g' /app/src/tailwind.css exec "$@" \ No newline at end of file diff --git a/dockerfile b/dockerfile index 87e785e..f48e164 100644 --- a/dockerfile +++ b/dockerfile @@ -14,7 +14,8 @@ ENV LOGO "/logo.png" ENV HEADER "true" ENV HEADERLINE "true" ENV CATEGORIES "normal" -ENV BGCOLOR "#f8fafc" +ENV BGCOLOR "theme(colors.slate.50)" +ENV THEME "light" EXPOSE 4173 diff --git a/readme.md b/readme.md index 5738d19..897c56b 100644 --- a/readme.md +++ b/readme.md @@ -89,6 +89,7 @@ services: - HEADERLINE=true # defaults to true, set to false to turn off the header border line - CATEGORIES=small # defaults to normal, set to small for smaller, uppercase category labels - BGCOLOR=#fff # defaults to theme(colors.slate.50), set to any hex color or Tailwind color using the theme syntax (e.g. BGCOLOR=theme(colors.sky.100) for bg-sky-100) + - THEME=light # defaults to light, set to dark for dark mode volumes: - ./config.json:/app/src/config.json # required - ./public/favicon.ico:/app/public/favicon.ico # optional diff --git a/src/components/service-catalogs.tsx b/src/components/service-catalogs.tsx index b3f6ae8..3dccb68 100644 --- a/src/components/service-catalogs.tsx +++ b/src/components/service-catalogs.tsx @@ -23,22 +23,22 @@ interface ICatalogProps { } const ServiceCatalog: React.FunctionComponent = ({ catalog, index }) => { - let categoryClassName = ""; + let categoryClassName = "dark:text-slate-200"; switch (CATEGORIES as string) { case "small": - categoryClassName = "text-sm text-slate-800 font-semibold py px-4 uppercase"; + categoryClassName += " text-sm text-slate-800 font-semibold py px-4 uppercase"; break; case "normal": default: - categoryClassName = "text-2xl text-slate-600 font-light py-2 px-4"; + categoryClassName += " text-2xl text-slate-600 font-light py-2 px-4"; break; } let liClassName = "mt-12 first:mt-0 xl:first:mt-6"; if (catalog.bubble) { - liClassName += " bg-white rounded-2xl px-6 py-8 ring-1 ring-slate-900/5 shadow-xl"; + liClassName += " bg-white dark:bg-black rounded-2xl px-6 py-8 ring-1 ring-slate-900/5 shadow-xl"; } return ( diff --git a/src/components/services.tsx b/src/components/services.tsx index 1944664..1877b00 100644 --- a/src/components/services.tsx +++ b/src/components/services.tsx @@ -47,7 +47,7 @@ const Service: React.FunctionComponent = ({ service, index }) => {!is.null(description) && ( -

+

{description} diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 3dec5a9..3b81259 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -16,18 +16,21 @@ export const IndexPage: React.FunctionComponent = ({ icon, title }) => { let headerClassName = "w-full xl:w-auto xl:max-w-xs xl:min-h-screen p-4"; if (SHOWHEADERLINE) { - headerClassName += "border-0 border-solid border-b xl:border-r xl:border-b-0 border-gray-300"; + headerClassName += + "border-0 border-solid border-b xl:border-r xl:border-b-0 border-gray-300 dark:border-gray-700"; } return ( -

- {SHOWHEADER && ( -
-
+
+
+ {SHOWHEADER && ( +
+
+
+ )} +
+
- )} -
-
); diff --git a/src/tailwind.css b/src/tailwind.css index dd440ea..93a9cc3 100644 --- a/src/tailwind.css +++ b/src/tailwind.css @@ -8,6 +8,10 @@ html { body { min-height: 100vh; + + @media (prefers-color-scheme: dark) { + color: theme(colors.slate.200); + } } h1 { diff --git a/src/variables.ts b/src/variables.ts index 8557e50..8f8391c 100644 --- a/src/variables.ts +++ b/src/variables.ts @@ -3,3 +3,4 @@ export const PAGEICON = "/logo.png"; export const SHOWHEADER = true; export const SHOWHEADERLINE = true; export const CATEGORIES = "small"; +export const THEME = "light";