Sql server management studio dark theme for whole program
Here's the automated way to make it easier to enable SSMS Dark Theme in SQL Server 2014+. It's re-entrant also in case you've already executed it. It will make a backup first just in case you are concerned about recovery. Inspired by this manual guide.
PS CommandLet to Enable Dark SSMS Theme
function EnableDarkSSMSTheme() {
$ssmsConfig = "C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\ManagementStudio\ssms.pkgundef"
$fileContent = get-content $ssmsConfig
Set-Content -path ([System.IO.Path]::ChangeExtension($ssmsConfig, "backup")) -value $fileContent # backup original file
$startContext = $fileContent | Select-String "// Remove Dark theme" -context 0, 100 | Select-Object LineNumber, Line -ExpandProperty Context | select-object LineNumber, PostContext # grab start context
$endContext = $startContext.PostContext | select-string "//" | Select Line, @{Name="LineNumber";Expression={$_.LineNumber + $startContext.LineNumber - 3}} -First 1 # grab end context, offset line # for ending
for($i = $startContext.LineNumber-1; $i -le $endContext.LineNumber; $i++) { $fileContent[$i] = "//$($fileContent[$i])" } # prefix lines to comment
Set-Content -path $ssmsConfig -value $fileContent # persist changes
}
EnableDarkSSMSTheme
kill -name ssms
start-process ssms
Note: For version upgrades v17.2 to v17.3, the program file configurations get overwritten and you have to re-apply this script.
For SSMS 2016 Open C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\ManagementStudio\ssms.pkgundef
Goto
// Remove Dark theme
[$RootKey$\Themes{1ded0138-47ce-435e-84ef-9ec1f439b749}]
and comment above settings,like this, then restart SSMS, you will sort there is a new option Dark in the Color theme option.
// Remove Dark theme
//[$RootKey$\Themes{1ded0138-47ce-435e-84ef-9ec1f439b749}]
Since SQL Server Management Studio is built inside of the Visual Studio Shell, restoring the Visual Studio Dark color theme will apply the theme to elements in SSMS that are also in Visual Studio or use Visual Studio controls:
- Window body
- Main menus
- Query editor
- Solution Explorer
- etc.
The VS dark theme does not style elements that are unique to SSMS, leaving them well-lit:
- Object Explorer
- Messages panel
- Execution plan panel
- Connection dialog
- etc.
The VS dark theme partially styles that are modified versions of VS controls, rendering them unattractive at best:
- Results grid, where NULL values become white text on a light yellow background
- Object Explorer context menus, where fly-out menus are displayed with black text on a dark grey background.
This is totally better than nothing, but really not ideal. It's bothered me enough that I'm working on a solution. Here's a screenshot of my work in progress:
It's an SSMS add-on that automatically sets dark mode wherever possible, overriding SSMS' controls' colors. Looking for folks to help me test it. Check it out at sqlshades.com