File tree Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -100,23 +100,16 @@ mw: 600
100100 - \`\`\`showMenu: false\`\`\` \\ to hide the menu
101101` ) ;
102102
103- // Theme store implementation (unchanged)
104103function createThemeStore ( ) {
105104 const { subscribe, set, update } = writable ( "light" ) ;
106105
107106 function updateBrowserTheme ( theme ) {
108107 if ( typeof window === "undefined" ) return ;
109108 const themeColor = theme === "dark" ? "#1a1a1a" : "#FCFCF9" ;
110- const metaTags = document . querySelectorAll ( 'meta[name="theme-color"]' ) ;
111- metaTags . forEach ( ( tag ) => {
112- if (
113- ( theme === "light" && tag . media === "(prefers-color-scheme: light)" ) ||
114- ( theme === "dark" && tag . media === "(prefers-color-scheme: dark)" ) ||
115- ! tag . media
116- ) {
117- tag . setAttribute ( "content" , themeColor ) ;
118- }
119- } ) ;
109+ const metaTag = document . querySelector ( 'meta[name="theme-color"]' ) ;
110+ if ( metaTag ) {
111+ metaTag . setAttribute ( "content" , themeColor ) ;
112+ }
120113 }
121114
122115 if ( typeof window !== "undefined" ) {
You can’t perform that action at this time.
0 commit comments