diff --git a/apps/login/app/(login)/layout.tsx b/apps/login/app/(login)/layout.tsx index 157775e3422..61622bb70da 100644 --- a/apps/login/app/(login)/layout.tsx +++ b/apps/login/app/(login)/layout.tsx @@ -7,7 +7,7 @@ export default async function Layout({ children: React.ReactNode; }) { return ( -
+
diff --git a/apps/login/app/layout.tsx b/apps/login/app/layout.tsx index 74f890c89e4..74e59aa81dc 100644 --- a/apps/login/app/layout.tsx +++ b/apps/login/app/layout.tsx @@ -45,8 +45,8 @@ export default async function RootLayout({
-
-
+
+
@@ -54,7 +54,7 @@ export default async function RootLayout({
-
+
{children}
diff --git a/apps/login/app/page.tsx b/apps/login/app/page.tsx index 9d368721d17..ccc59dfbc0e 100644 --- a/apps/login/app/page.tsx +++ b/apps/login/app/page.tsx @@ -1,5 +1,4 @@ import { demos } from "#/lib/demos"; -import ThemeWrapper from "#/ui/ThemeWrapper"; import Link from "next/link"; export default function Page() { diff --git a/apps/login/lib/zitadel.ts b/apps/login/lib/zitadel.ts index 34ee318a0eb..360e8d27b2c 100644 --- a/apps/login/lib/zitadel.ts +++ b/apps/login/lib/zitadel.ts @@ -28,7 +28,6 @@ export function getBranding( server: ZitadelServer ): Promise { const mgmt = getManagement(server); - console.log(process.env.ZITADEL_ORG_ID); return mgmt .getLabelPolicy( {}, diff --git a/apps/login/styles/globals.scss b/apps/login/styles/globals.scss index 2032f80e8d4..46ccb9741e8 100755 --- a/apps/login/styles/globals.scss +++ b/apps/login/styles/globals.scss @@ -20,7 +20,7 @@ html { --dark-background-color: #000000; } -$types: "background", "primary", "warn", "text"; +$types: "background", "primary", "warn"; $shades: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900; @each $type in $types { @@ -38,5 +38,36 @@ $shades: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900; .dark .dark\:text-#{$type}-dark-#{$shade} { color: var(--theme-dark-#{$type}-#{$shade}) !important; } + + .text-#{$type}-light-contrast-#{$shade} { + color: var(--theme-light-#{$type}-contrast-#{$shade}) !important; + } + .dark .dark\:text-#{$type}-dark-contrast-#{$shade} { + color: var(--theme-dark-#{$type}-contrast-#{$shade}) !important; + } + } +} + +$alphatypes: "text", "link"; + +@each $alphatype in $alphatypes { + .text-#{$alphatype}-light { + color: var(--theme-light-#{$alphatype}) !important; + } + .text-#{$alphatype}-light-contrast { + color: var(--theme-light-#{$alphatype}-contrast) !important; + } + .text-#{$alphatype}-light-secondary { + color: var(--theme-light-#{$alphatype}-secondary) !important; + } + + .dark .dark\:text-#{$alphatype}-dark { + color: var(--theme-dark-#{$alphatype}) !important; + } + .dark .dark\:text-#{$alphatype}-dark-contrast { + color: var(--theme-dark-#{$alphatype}-contrast) !important; + } + .dark .dark\:text-#{$alphatype}-dark-secondary { + color: var(--theme-dark-#{$alphatype}-secondary) !important; } } diff --git a/apps/login/ui/Avatar.tsx b/apps/login/ui/Avatar.tsx index b4e9829eaac..7275da2b00f 100644 --- a/apps/login/ui/Avatar.tsx +++ b/apps/login/ui/Avatar.tsx @@ -58,7 +58,7 @@ export const Avatar: FC = ({ return (
{ return (
-
+
{section.name}
@@ -90,9 +90,9 @@ function GlobalNavItem({ className={clsx( "block rounded-md px-3 py-2 text-sm font-medium hover:text-black dark:hover:text-gray-300", { - "text-gray-500 dark:text-gray-500 hover:bg-gray-100 hover:dark:bg-gray-800": + "text-text-light-secondary dark:text-text-dark-secondary hover:text-text-light hover:dark:text-text-dark": !isActive, - "text-gray-800 dark:text-gray-200": isActive, + "text-primary-light-500 dark:text-primary-dark-500": isActive, } )} > diff --git a/apps/login/ui/LayoutProviders.tsx b/apps/login/ui/LayoutProviders.tsx index 38e21823b9b..50b92cbb937 100644 --- a/apps/login/ui/LayoutProviders.tsx +++ b/apps/login/ui/LayoutProviders.tsx @@ -7,8 +7,8 @@ type Props = { }; export function LayoutProviders({ children }: Props) { - const { resolvedTheme } = useTheme(); - const isDark = resolvedTheme && resolvedTheme === "dark"; + // const { resolvedTheme } = useTheme(); + const isDark = false; //resolvedTheme && resolvedTheme === "dark"; // useEffect(() => { // console.log("layoutproviders useeffect"); diff --git a/apps/login/utils/colors.ts b/apps/login/utils/colors.ts index 39c142c08b4..675861bac8b 100644 --- a/apps/login/utils/colors.ts +++ b/apps/login/utils/colors.ts @@ -84,25 +84,34 @@ export function setTheme(document: any, policy?: LabelPolicyColors) { const dark = computeMap(lP, true); const light = computeMap(lP, false); - console.log(dark, light); + setColorShades(dark.background, "background", "dark", document); + setColorShades(light.background, "background", "light", document); - setColors(dark.background, "background", "dark", document); - setColors(light.background, "background", "light", document); + setColorShades(dark.primary, "primary", "dark", document); + setColorShades(light.primary, "primary", "light", document); - setColors(dark.primary, "primary", "dark", document); - setColors(light.primary, "primary", "light", document); + setColorShades(dark.warn, "warn", "dark", document); + setColorShades(light.warn, "warn", "light", document); - setColors(dark.text, "primary", "dark", document); - setColors(light.text, "primary", "light", document); + // setColorShades(dark.text, "text", "dark", document); + // setColorShades(light.text, "text", "light", document); - setColors(dark.link, "link", "dark", document); - setColors(light.link, "link", "light", document); + // setColorShades(dark.link, "link", "dark", document); + // setColorShades(light.link, "link", "light", document); - setColors(dark.warn, "warn", "dark", document); - setColors(light.warn, "warn", "light", document); + setColorAlpha(dark.text, "text", "dark", document); + setColorAlpha(light.text, "text", "light", document); + + setColorAlpha(dark.link, "link", "dark", document); + setColorAlpha(light.link, "link", "light", document); } -function setColors(map: Color[], type: string, theme: string, document: any) { +function setColorShades( + map: Color[], + type: string, + theme: string, + document: any +) { map.forEach((color) => { document.documentElement.style.setProperty( `--theme-${theme}-${type}-${color.name}`, @@ -115,6 +124,30 @@ function setColors(map: Color[], type: string, theme: string, document: any) { }); } +function setColorAlpha( + map: Color[], + type: string, + theme: string, + document: any +) { + const color = map.find((color) => color.name === "500"); + + if (color) { + document.documentElement.style.setProperty( + `--theme-${theme}-${type}`, + color.hex + ); + document.documentElement.style.setProperty( + `--theme-${theme}-${type}-contrast`, + color.contrastColor + ); + document.documentElement.style.setProperty( + `--theme-${theme}-${type}-secondary`, + `${color.hex}80` + ); + } +} + function computeColors(hex: string): Color[] { return [ getColorObject(tinycolor(hex).lighten(52), "50"), diff --git a/packages/zitadel-react/src/components/SignInWithGitlab.tsx b/packages/zitadel-react/src/components/SignInWithGitlab.tsx index 8e3d5afa529..9100d27f2f9 100644 --- a/packages/zitadel-react/src/components/SignInWithGitlab.tsx +++ b/packages/zitadel-react/src/components/SignInWithGitlab.tsx @@ -6,8 +6,8 @@ export interface SignInWithGitlabProps { export function SignInWithGitlab(props: SignInWithGitlabProps) { return ( -
-
+
+
- Sign in with Gitlab + Sign in with Gitlab
); } diff --git a/packages/zitadel-react/src/components/SignInWithGoogle.tsx b/packages/zitadel-react/src/components/SignInWithGoogle.tsx index 83368eb2b3c..a6e597149bb 100644 --- a/packages/zitadel-react/src/components/SignInWithGoogle.tsx +++ b/packages/zitadel-react/src/components/SignInWithGoogle.tsx @@ -6,8 +6,8 @@ export interface SignInWithGoogleProps { export function SignInWithGoogle(props: SignInWithGoogleProps) { return ( -
-
+
+
- Sign in with Google + Sign in with Google
); } diff --git a/packages/zitadel-react/src/components/ZitadelUIProvider.tsx b/packages/zitadel-react/src/components/ZitadelUIProvider.tsx index 2caa5a64474..f4838bb8218 100644 --- a/packages/zitadel-react/src/components/ZitadelUIProvider.tsx +++ b/packages/zitadel-react/src/components/ZitadelUIProvider.tsx @@ -4,5 +4,7 @@ export type ZitadelUIProps = { }; export function ZitadelUIProvider({ dark, children }: ZitadelUIProps) { - return
{children}
; + return ( +
{children}
+ ); } diff --git a/packages/zitadel-react/tailwind.config.js b/packages/zitadel-react/tailwind.config.js index 56f428d7fc4..db207600200 100644 --- a/packages/zitadel-react/tailwind.config.js +++ b/packages/zitadel-react/tailwind.config.js @@ -3,7 +3,7 @@ const sharedConfig = require("zitadel-tailwind-config/tailwind.config.js"); /** @type {import('tailwindcss').Config} */ module.exports = { presets: [sharedConfig], - prefix: "ui-", + prefix: "ztdl-", darkMode: "class", content: [`src/**/*.{js,ts,jsx,tsx}`], };