Skip to content

Commit 456614e

Browse files
feat(accent color): use color of navBar (#6391)
* feat(accent color): use color of header * fix: update type * fix: make it work correctly
1 parent c4ec78a commit 456614e

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

next.dynamic.constants.mjs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,16 @@ export const PAGE_METADATA = {
7979
* @return {import('next').Viewport}
8080
*/
8181
export const PAGE_VIEWPORT = {
82-
themeColor: siteConfig.accentColor,
82+
themeColor: [
83+
{
84+
color: siteConfig.lightAccentColor,
85+
media: '(prefers-color-scheme: light)',
86+
},
87+
{
88+
color: siteConfig.darkAccentColor,
89+
media: '(prefers-color-scheme: dark)',
90+
},
91+
],
8392
width: 'device-width',
8493
initialScale: 1,
8594
};

site.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"title": "Node.js",
33
"description": "Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine.",
44
"favicon": "/static/images/favicons/favicon.png",
5-
"accentColor": "#333",
5+
"lightAccentColor": "#FFFFFF",
6+
"darkAccentColor": "#0D121C",
67
"twitter": {
78
"username": "@nodejs",
89
"card": "summary",

types/config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ export interface SiteConfig {
2929
description: string;
3030
featuredImage: string;
3131
favicon: string;
32-
accentColor: string;
32+
lightAccentColor: string;
33+
darkAccentColor: string;
3334
og: OGConfig;
3435
twitter: TwitterConfig;
3536
rssFeeds: Array<RSSFeed>;

0 commit comments

Comments
 (0)