Skip to content

Commit

Permalink
fix(theme): default to dark mode
Browse files Browse the repository at this point in the history
  • Loading branch information
GZTimeWalker committed Oct 26, 2024
1 parent e7efed3 commit d6c4d1a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
19 changes: 19 additions & 0 deletions rspress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,20 @@ export default defineConfig({
],
markdown: {
checkDeadLinks: true,
showLineNumbers: true,
highlightLanguages: [
['js', 'javascript'],
['ts', 'typescript'],
['jsx', 'tsx'],
['xml', 'xml-doc'],
['md', 'markdown'],
['mdx', 'tsx'],
['yml', 'yaml'],
['py', 'python'],
['sh', 'bash'],
['json', 'json'],
['txt', 'plaintext']
]
},
ssg: {
strict: true,
Expand Down Expand Up @@ -50,6 +64,8 @@ export default defineConfig({
content: "https://discord.gg/dV9A6ZjVhC",
},
],
lastUpdated: true,
enableScrollToTop: true,
enableContentAnimation: true,
enableAppearanceAnimation: false,
footer: {
Expand All @@ -63,6 +79,7 @@ export default defineConfig({
outlineTitle: "目录",
prevPageText: "上一页",
nextPageText: "下一页",
lastUpdatedText: "最后更新于",
searchPlaceholderText: "搜索文档",
searchNoResultsText: "没有找到有关内容",
searchSuggestedQueryText: "建议更换不同的关键字后重试",
Expand All @@ -73,6 +90,7 @@ export default defineConfig({
outlineTitle: "Table of Contents",
prevPageText: "Previous",
nextPageText: "Next",
lastUpdatedText: "Last Updated",
searchPlaceholderText: "Search Docs",
searchNoResultsText: "No results for",
searchSuggestedQueryText: "Please try again with a different keyword",
Expand All @@ -83,6 +101,7 @@ export default defineConfig({
outlineTitle: "目次",
prevPageText: "前へ",
nextPageText: "次へ",
lastUpdatedText: "最終更新",
searchPlaceholderText: "ドキュメントを検索",
searchNoResultsText: "関連する結果がありません",
}
Expand Down
6 changes: 3 additions & 3 deletions theme/components/LogoHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ export const LogoHeader: FC = () => {
const pageData = usePageData();
const defaultLang = pageData.siteData.lang ?? "";
const lang = pageData.page.lang;
const darkMode = theme === "dark";
const color = darkMode ? "#fff" : "#414141";
const highlightColor = darkMode ? "#0AD7AF" : "#02BFA5";
const lightMode = theme === "light";
const color = lightMode ? "#414141" : "#fff";
const highlightColor = lightMode ? "#02BFA5" : "#0AD7AF";

return (
<div style={{ display: "flex", alignItems: "center", gap: "2px" }}>
Expand Down
2 changes: 1 addition & 1 deletion theme/components/icon/MainIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const MainIcon: FC<MainIconProps> = (props: MainIconProps) => {
const { ignoreTheme, ...svgProps } = props;
const { theme } = useContext(ThemeContext);

const color = theme === "dark" ? "#fff" : "#414141";
const color = theme === "light" ? "#414141" : "#fff";

return (
<svg width="480" height="480" viewBox="0 0 4800 4800" {...svgProps}>
Expand Down

0 comments on commit d6c4d1a

Please sign in to comment.