From d163f0da149c5d832ff27ab31d7c7afc3599be97 Mon Sep 17 00:00:00 2001 From: Glen Huang Date: Wed, 17 Sep 2025 23:01:24 +0800 Subject: [PATCH] ui/onboarding: use css modules --- .../ui/src/routes/Onboarding/Onboarding.css | 70 ------------------- .../routes/Onboarding/Onboarding.module.css | 67 ++++++++++++++++++ .../ui/src/routes/Onboarding/Onboarding.tsx | 26 +++---- 3 files changed, 80 insertions(+), 83 deletions(-) delete mode 100644 pkgs/clan-app/ui/src/routes/Onboarding/Onboarding.css create mode 100644 pkgs/clan-app/ui/src/routes/Onboarding/Onboarding.module.css diff --git a/pkgs/clan-app/ui/src/routes/Onboarding/Onboarding.css b/pkgs/clan-app/ui/src/routes/Onboarding/Onboarding.css deleted file mode 100644 index f1eac3ebd..000000000 --- a/pkgs/clan-app/ui/src/routes/Onboarding/Onboarding.css +++ /dev/null @@ -1,70 +0,0 @@ -main#welcome { - @apply absolute top-0 left-0; - @apply flex items-center justify-center; - @apply min-h-screen w-full; - - div.background { - .layer-1 { - @apply -z-30; - background: - url("./background.png") 0 -69.032px / 100% 119.049% no-repeat, - url("./background.png") 50% / cover no-repeat; - } - - .layer-2 { - @apply -z-20; - background: #103131; - mix-blend-mode: screen; - } - - .layer-3 { - @apply -z-10; - background: #749095; - mix-blend-mode: soft-light; - } - - .layer-1, - .layer-2, - .layer-3 { - @apply absolute top-0 left-0 w-full h-full; - } - - svg[data-logo-name="Clan"] { - @apply w-16; - @apply absolute bottom-28 left-1/2 transform -translate-x-1/2; - } - - button.list-clans { - @apply absolute bottom-28 right-0 transform -translate-x-1/2; - } - } - - & > div.container { - @apply flex flex-col items-center justify-evenly gap-y-20 size-fit; - - & > div.welcome { - @apply flex flex-col w-80 gap-y-6; - - & > div.separator { - @apply grid grid-cols-3 grid-rows-1 gap-x-4 items-center; - } - } - - & > div.setup { - @apply flex flex-col w-[33rem] gap-y-5; - @apply pt-10 px-8 pb-8 bg-def-1 rounded-lg; - - & > div.header { - @apply flex items-center justify-start gap-x-2; - } - - form { - @apply flex flex-col gap-y-5; - - & > div.form-controls { - @apply flex justify-end pt-6; - } - } - } - } -} diff --git a/pkgs/clan-app/ui/src/routes/Onboarding/Onboarding.module.css b/pkgs/clan-app/ui/src/routes/Onboarding/Onboarding.module.css new file mode 100644 index 000000000..abdce9bd5 --- /dev/null +++ b/pkgs/clan-app/ui/src/routes/Onboarding/Onboarding.module.css @@ -0,0 +1,67 @@ +.onboarding { + @apply absolute top-0 left-0; + @apply flex items-center justify-center; + @apply min-h-screen w-full; +} + +.background { + svg[data-logo-name="Clan"] { + @apply w-16; + @apply absolute bottom-28 left-1/2 transform -translate-x-1/2; + } +} + +.backgroundLayer1 { + @apply -z-30; + background: + url("./background.png") 0 -69.032px / 100% 119.049% no-repeat, + url("./background.png") 50% / cover no-repeat; +} + +.backgroundLayer2 { + @apply -z-20; + background: #103131; + mix-blend-mode: screen; +} + +.backgroundLayer3 { + @apply -z-10; + background: #749095; + mix-blend-mode: soft-light; +} + +.backgroundLayer1, +.backgroundLayer2, +.backgroundLayer3 { + @apply absolute top-0 left-0 w-full h-full; +} + +.listClans { + @apply absolute bottom-28 right-0 transform -translate-x-1/2; +} + +.container { + @apply flex flex-col items-center justify-evenly gap-y-20 size-fit; +} + +.welcome { + @apply flex flex-col w-80 gap-y-6; +} +.welcomeSeparator { + @apply grid grid-cols-3 grid-rows-1 gap-x-4 items-center; +} + +.setup { + @apply flex flex-col w-[33rem] gap-y-5; + @apply pt-10 px-8 pb-8 bg-def-1 rounded-lg; + + form { + @apply flex flex-col gap-y-5; + } +} +.setupHeader { + @apply flex items-center justify-start gap-x-2; +} +.setupFormControls { + @apply flex justify-end pt-6; +} diff --git a/pkgs/clan-app/ui/src/routes/Onboarding/Onboarding.tsx b/pkgs/clan-app/ui/src/routes/Onboarding/Onboarding.tsx index 39259a873..2f236a04a 100644 --- a/pkgs/clan-app/ui/src/routes/Onboarding/Onboarding.tsx +++ b/pkgs/clan-app/ui/src/routes/Onboarding/Onboarding.tsx @@ -12,7 +12,7 @@ import { useNavigate, useSearchParams, } from "@solidjs/router"; -import "./Onboarding.css"; +import styles from "./Onboarding.module.css"; import { Typography } from "@/src/components/Typography/Typography"; import { Button } from "@/src/components/Button/Button"; import { Alert } from "@/src/components/Alert/Alert"; @@ -66,13 +66,13 @@ const background = (props: { state: State; form: FormStore }) => { const [showModal, setShowModal] = createSignal(false); return ( -
-
-
-
+
+
+
+
-
+
= (props) => { }; return ( -
+
{background({ form: setupForm, state: state() })} -
+
{welcome({ @@ -298,8 +298,8 @@ export const Onboarding: Component = (props) => { -
-
+
+