Available NuGet Distribution Versions
Windows x86 Commandline
Visual Studio 2015
Visual Studio 2017
NuGet 4.x is included in the Visual Studio 2017 installation. Latest NuGet releases are delivered as part of Visual Studio updates.
// Check the browser preferred color scheme const prefersDarkMode = window.matchMedia("(prefers-color-scheme: dark)").matches; const defaultTheme = prefersDarkMode ? "dark" : "light"; const preferredTheme = localStorage.getItem("theme") // Check if the localStorage item is set, if not set it to the system theme if (!preferredTheme || !(preferredTheme === "dark" || preferredTheme === "light")) { localStorage.setItem("theme", "system"); } if (preferredTheme === "light" || preferredTheme === "dark") { document.documentElement.setAttribute('data-theme', preferredTheme); } else { document.documentElement.setAttribute('data-theme', defaultTheme); }
NuGet 4.x is included in the Visual Studio 2017 installation. Latest NuGet releases are delivered as part of Visual Studio updates.