Closed mayank99 closed 1 month ago
This essentially backports #1735 to v2. It's necessary for applications to incrementally migrate to v3 while maintaining a coherent look.
(I've already noticed a few places where theme v2 UI stays in light theme when application theme switches to dark)
Tested behavior in vite playground by installing itwinui-v3 as an npm alias.
itwinui-v3
Note for reviewers: If you're testing this locally, it probably should be done in a separate clone of the repo, because it is so different from the v3 codebase.
Changeset added.
Changes
This essentially backports #1735 to v2. It's necessary for applications to incrementally migrate to v3 while maintaining a coherent look.
(I've already noticed a few places where theme v2 UI stays in light theme when application theme switches to dark)
Testing
Tested behavior in vite playground by installing
itwinui-v3
as an npm alias.main.tsx
```tsx import * as React from 'react'; import { createRoot } from 'react-dom/client'; import styled from '@emotion/styled'; import { ThemeProvider } from '@itwin/itwinui-react'; import { ThemeProvider as ThemeProviderV3 } from 'itwinui-v3'; import App from './App'; import { SvgMoon, SvgSun } from '@itwin/itwinui-icons-react'; const Shell = () => { const [theme, setTheme] = React.useState<'light' | 'dark'>(() => matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light', ); const [highContrast, setHighContrast] = React.useState(false); return ( <>Note for reviewers: If you're testing this locally, it probably should be done in a separate clone of the repo, because it is so different from the v3 codebase.
Docs
Changeset added.