diff --git a/.changeset/tame-frogs-pump.md b/.changeset/tame-frogs-pump.md new file mode 100644 index 0000000000..f268ffcf42 --- /dev/null +++ b/.changeset/tame-frogs-pump.md @@ -0,0 +1,7 @@ +--- +"sit-onyx": minor +"docs": minor +--- + +- added light/dark mode transition +- created the useThemeTransition composable, which observes changes between light and dark mode and dynamically adds the onyx-transition-active class during the transition for a smooth visual effect. See our [docs](https://onyx.schwarz/development/typography.html) on how to use it. diff --git a/apps/demo-app/src/App.vue b/apps/demo-app/src/App.vue index bd13c5c3da..fbab0d65dd 100644 --- a/apps/demo-app/src/App.vue +++ b/apps/demo-app/src/App.vue @@ -10,6 +10,7 @@ import { OnyxNavButton, OnyxToast, OnyxUserMenu, + useThemeTransition, type OnyxNavButtonProps, } from "sit-onyx"; import { ref, watch, type ComponentInstance } from "vue"; @@ -29,7 +30,8 @@ const navItems = [ { label: "Data-Grid Demo", href: "/data-grid" }, ] satisfies OnyxNavButtonProps[]; -const { store: colorScheme } = useColorMode(); +const { store: colorScheme } = useColorMode({ disableTransition: false }); +useThemeTransition(colorScheme); const navBarRef = ref>(); diff --git a/apps/docs/playwright/snapshots/development-theming-edge-linux.png b/apps/docs/playwright/snapshots/development-theming-edge-linux.png index 060b544817..eb45f83222 100644 Binary files a/apps/docs/playwright/snapshots/development-theming-edge-linux.png and b/apps/docs/playwright/snapshots/development-theming-edge-linux.png differ diff --git a/apps/docs/playwright/snapshots/development-theming-firefox-linux.png b/apps/docs/playwright/snapshots/development-theming-firefox-linux.png index 415de99130..466efbaa9f 100644 Binary files a/apps/docs/playwright/snapshots/development-theming-firefox-linux.png and b/apps/docs/playwright/snapshots/development-theming-firefox-linux.png differ diff --git a/apps/docs/playwright/snapshots/development-theming-webkit-linux.png b/apps/docs/playwright/snapshots/development-theming-webkit-linux.png index 0d26a1c29d..e04a898299 100644 Binary files a/apps/docs/playwright/snapshots/development-theming-webkit-linux.png and b/apps/docs/playwright/snapshots/development-theming-webkit-linux.png differ diff --git a/apps/docs/src/.vitepress/theme/TheLayout.vue b/apps/docs/src/.vitepress/theme/TheLayout.vue index 884efb9e93..3232bb0d16 100644 --- a/apps/docs/src/.vitepress/theme/TheLayout.vue +++ b/apps/docs/src/.vitepress/theme/TheLayout.vue @@ -1,8 +1,11 @@