From a3225bbc448c7af953ce4f1edf5ee21d56e2d67b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Thune?= Date: Wed, 11 Dec 2024 13:39:06 +0100 Subject: [PATCH] chore: some themebuilder fixes (#2879) Header: * Add `temabygger` to the menu on both designsystemet.no and theme.designsystemet.no * Make the menu be the same both places. * Added a new prop `logoLink` so it can be linked to designsystemet.no from the themebuilder Front page: * Fix some colors on the front page when switching themes on the previews * Add description text * Make documentation button link to designsystemet.no/eget-tema. Theme-name page * Add text * Change layout to be more in line with the rest of the design with tabs. Will look at flow a bit later. Color page: * Change FAIL tag to DECO after feedback. Radius page: * Add a message that tells the user that this will not be available with the CLI yet. Sidebar: * Made it a bit more responsive --- .../src/Container/Container.module.css | 2 +- apps/_components/src/Header/Header.tsx | 4 +- apps/storefront/app/layout.tsx | 4 +- apps/theme/app/globals.css | 18 +++- apps/theme/app/layout.tsx | 34 +++++-- apps/theme/app/page.module.css | 2 +- apps/theme/app/page.tsx | 23 +++-- apps/theme/app/themebuilder/page.module.css | 18 ---- apps/theme/app/themebuilder/page.tsx | 71 +++++--------- apps/theme/app/welcome/page.module.css | 26 ++--- apps/theme/app/welcome/page.tsx | 56 +++++++++-- .../ColorContrasts/ColorContrasts.tsx | 4 +- .../theme/components/Header/Header.module.css | 17 ++++ apps/theme/components/Header/Header.tsx | 44 +++++++++ .../components/Previews/Previews.module.css | 28 +----- apps/theme/components/Previews/Previews.tsx | 97 ++++++------------- .../components/Previews/Theme1/Theme1.tsx | 3 + .../Sidebar/ColorPage/ColorPage.module.css | 1 - .../Sidebar/ColorPage/ColorPage.tsx | 18 +--- .../Sidebar/ColorPane/ColorPane.module.css | 1 + .../Sidebar/RadiusPage/RadiusPage.module.css | 12 +-- .../Sidebar/RadiusPage/RadiusPage.tsx | 22 +---- .../components/Sidebar/Sidebar.module.css | 17 ++-- apps/theme/components/Sidebar/Sidebar.tsx | 49 +--------- .../theme/components/Toggle/Toggle.module.css | 2 +- .../ToggleChip/ToggleChip.module.css | 31 ++++++ .../components/ToggleChip/ToggleChip.tsx | 41 ++++++++ apps/theme/components/index.ts | 2 + 28 files changed, 346 insertions(+), 301 deletions(-) create mode 100644 apps/theme/components/Header/Header.module.css create mode 100644 apps/theme/components/Header/Header.tsx create mode 100644 apps/theme/components/ToggleChip/ToggleChip.module.css create mode 100644 apps/theme/components/ToggleChip/ToggleChip.tsx diff --git a/apps/_components/src/Container/Container.module.css b/apps/_components/src/Container/Container.module.css index 503558b48c..dab0853570 100644 --- a/apps/_components/src/Container/Container.module.css +++ b/apps/_components/src/Container/Container.module.css @@ -1,5 +1,5 @@ .container { - max-width: var(--grid-max-width, 1450px); + max-width: var(--grid-max-width, 1500px); margin: 0 auto; width: 100%; padding-left: var(--grid-padding, 16px); diff --git a/apps/_components/src/Header/Header.tsx b/apps/_components/src/Header/Header.tsx index 85b429bbaa..9fe920f1ac 100644 --- a/apps/_components/src/Header/Header.tsx +++ b/apps/_components/src/Header/Header.tsx @@ -27,6 +27,7 @@ type HeaderProps = { skipLink?: boolean; themeSwitcher?: boolean; transparentBackground?: boolean; + logoLink?: string; }; /** @@ -65,6 +66,7 @@ const Header = ({ skipLink = true, themeSwitcher = false, transparentBackground = false, + logoLink = '/', }: HeaderProps) => { const [open, setOpen] = useState(false); const [isHamburger, setIsHamburger] = useState(false); @@ -120,7 +122,7 @@ const Header = ({
setOpen(false)} prefetch={false} diff --git a/apps/storefront/app/layout.tsx b/apps/storefront/app/layout.tsx index 967424b94a..78462668b0 100644 --- a/apps/storefront/app/layout.tsx +++ b/apps/storefront/app/layout.tsx @@ -47,10 +47,10 @@ const menu = [ name: 'Komponenter', href: '/komponenter', }, - /* { + { name: 'Temabygger', href: 'https://next.theme.designsystemet.no', - }, */ + }, ]; const centerLinks = [ diff --git a/apps/theme/app/globals.css b/apps/theme/app/globals.css index cf2706bcd8..c2a5248be8 100644 --- a/apps/theme/app/globals.css +++ b/apps/theme/app/globals.css @@ -35,14 +35,28 @@ code { --ds-color-accent-base-default: #740c7e; --ds-color-accent-text-subtle: #93429b; --ds-color-base-default: #740c7e; - --ds-color-accent-surface-hover: #6c0b75 !important; + --ds-color-base-hover: #872d90; + --ds-color-base-active: #97499f; + --ds-color-accent-surface-default: #ecdded; + --ds-color-accent-surface-hover: #e0cae3; + --ds-color-accent-surface-active: #d6b7d9; + --ds-color-accent-border-subtle: #d2b0d5; + --ds-color-accent-border-default: #a867af; + --ds-color-accent-text-default: #4f0856; } [data-color-scheme='dark'][data-theme='two'] { --ds-color-accent-base-default: #c79dcb; --ds-color-accent-text-subtle: #c294c6; --ds-color-base-default: #c79dcb; - --ds-color-accent-surface-hover: #6c0b75 !important; + --ds-color-base-hover: #b884be; + --ds-color-base-active: #aa6ab0; + --ds-color-accent-surface-default: #56095e; + --ds-color-accent-surface-hover: #6c0b75; + --ds-color-accent-surface-active: #7e1e87; + --ds-color-accent-border-subtle: #84298d; + --ds-color-accent-border-default: #a664ad; + --ds-color-accent-text-default: #ecdded; } .panelContainer { diff --git a/apps/theme/app/layout.tsx b/apps/theme/app/layout.tsx index 8c6f3ca838..ea6a675ca2 100644 --- a/apps/theme/app/layout.tsx +++ b/apps/theme/app/layout.tsx @@ -15,13 +15,29 @@ export const metadata: Metadata = { }; const menu = [ - /* { - name: 'Fargevelger', - href: '/', - }, */ { - name: 'Slik bruker du verktøyet', - href: '/slik-bruker-du-verktoyet', + name: 'Grunnleggende', + href: 'https://www.designsystemet.no/grunnleggende', + }, + { + name: 'God praksis', + href: 'https://www.designsystemet.no/god-praksis', + }, + { + name: 'Mønstre', + href: 'https://www.designsystemet.no/monstre', + }, + { + name: 'Bloggen', + href: 'https://www.designsystemet.no/bloggen', + }, + { + name: 'Komponenter', + href: 'https://www.designsystemet.no/komponenter', + }, + { + name: 'Temabygger', + href: '/', }, ]; @@ -72,7 +88,11 @@ export default function RootLayout({ -
+
{children}