GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - infonomic/theme: Bulletproof dark theme detection and switching for Next.js (or other SSR frameworks with minor modifications)

BranchesTags
Open more actions menu

Latest commit

 

History

9 Commits
9 Commits

Folders and files

NameName
Last commit message
Last commit date
app
app
 
 
public
public
 
 
.gitignore
.gitignore
 
 
COPYRIGHT
COPYRIGHT
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
eslint.config.mjs
eslint.config.mjs
 
 
next.config.ts
next.config.ts
 
 
package.json
package.json
 
 
pnpm-lock.yaml
pnpm-lock.yaml
 
 
pnpm-workspace.yaml
pnpm-workspace.yaml
 
 
postcss.config.mjs
postcss.config.mjs
 
 
tsconfig.json
tsconfig.json
 
 

Repository files navigation

Infonomic Theme

Bulletproof dark theme detection and switching for Next.js (or other SSR frameworks with minor modifications)

Implementation

A 'shim'-based Theme detector and switch with zero Flash of Unstyled Content (FOUC).

Our theme detector and switch determines theme settings based on:

  1. preferences in localStorage,
  2. prefers-color-scheme user agent,
  3. followed by a default theme in that order.

We use localStorage for preferences and NOT cookies as cookies will impact your page caching strategy. You'll need to cache variants of every page for both themes as well as detect cookies in your reverse proxy and page cache mechanics.

Using localStorage however, means we need to use an early-detection JavaScript shim combined with suppressHydrationWarning in our document root HTML element.

Getting started

npm install
npm run dev
# or
yarn install
yarn dev
# or
pnpm install
pnpm dev

Open http://localhost:3000 with your browser to see the result.

License

Infonomic Theme is free software licensed under the MIT license.

For full details, please refer to the LICENSE and COPYRIGHT files in this repository.

Copyright © 2025 Infonomic Company Limited contributors. https://infonomic.io

Major Contributors

  • Anthony Bouch https://www.linkedin.com/in/anthonybouch/ [email protected]
  • David Lipsky https://www.linkedin.com/in/david-lipsky-4391862a8/ [email protected]

About

Bulletproof dark theme detection and switching for Next.js (or other SSR frameworks with minor modifications)

infonomic-theme.vercel.app/

Topics

dark-themenextjs

Resources

Readme
MIT license
Activity
Custom properties

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.