diff --git a/package.json b/package.json index 1ae8066..11ac476 100644 --- a/package.json +++ b/package.json @@ -85,7 +85,7 @@ "@types/node": "^18.0.0", "@types/prompts": "^2.4.2", "@vitest/coverage-c8": "^0.29.8", - "@vitest/ui": "^0.29.8", + "@vitest/ui": "^0.30.0", "bumpp": "^9.1.0", "cross-env": "^7.0.3", "eslint": "8.32.0", diff --git a/packages/extension/chrome-option/components/Header-Bar.tsx b/packages/extension/chrome-option/components/Header-Bar.tsx index 07a0099..8de47f4 100644 --- a/packages/extension/chrome-option/components/Header-Bar.tsx +++ b/packages/extension/chrome-option/components/Header-Bar.tsx @@ -1,6 +1,6 @@ import { GithubOutlined, UserOutlined } from '@ant-design/icons' import { Avatar } from 'antd' -import { useState } from 'react' +import { useEffect, useState } from 'react' import { useMount } from 'ahooks' import { CarbonSun } from './icon-sun' import { CarbonMoon } from './icon-moon' @@ -36,13 +36,18 @@ export const HeaderBar = (props: HeaderBarProps = { else setDark(true) }) + + useEffect(() => { + const htmlEl = document.querySelector('html') as Element + htmlEl.className = dark ? 'dark' : '' + }, [dark]) return ( -