Next.js Theme Switcher is a VSCode extension that automatically changes your editor's color theme based on the type of file you're editing in a Next.js project.
- Automatically detects Next.js file types:
- Client-side files
- Server-side files
- Isomorphic/shared files
- Configurable themes for each file type
- Works only in Next.js projects (detected by presence of
next.config.js
)
You can configure the themes in your VSCode settings:
{
"nextjsThemeSwitcher.clientTheme": "Default Dark+",
"nextjsThemeSwitcher.serverTheme": "Default Light+",
"nextjsThemeSwitcher.isomorphicTheme": "Monokai"
}
The extension uses several heuristics to detect file types:
- Filename patterns
use client
anduse server
directives- Presence of React hooks and browser APIs
- Next.js specific file locations
- Client-side: Files with
.client.tsx
, incomponents/
orhooks/
directories - Server-side: Files with
.server.tsx
, inapi/
orserver/
directories - Isomorphic: Files with both client and server-side code
- Open VSCode
- Go to Extensions
- Search for "Next.js Theme Switcher"
- Click Install
- VSCode 1.85.0 or higher
- Next.js project
- Theme switching depends on accurate file type detection
- May not work perfectly with all project structures
Please report issues or suggestions on the GitHub repository.
[Your License Here]