Dark Mode style for UDL
-
Is it possible for a user-defined language to include additional information for dark mode?

Currently my UDL describes colors that are good for light mode (= white canvas/background)……but are hard to read in dark mode (= greyish canvas/background)…

Finding a middle ground seems quite hard, so I wondered if it is possible to modify the style for the dark mode the same way it works for the included languages?
Notepad++ v8.9.2 (64-bit) Build time: Feb 13 2026 - 02:47:53 Scintilla/Lexilla included: 5.5.8/5.4.6 Boost Regex included: 1_90 pugixml included: 1.15 nlohmann JSON included: 3.12.0 Path: C:\Program Files\Notepad++\notepad++.exe Command Line: C:\Development\GIT\SWLLIS\dbsystem\dbcreate\Befund\befundauftrag.pro Admin mode: OFF Local Conf mode: OFF Cloud Config: OFF Periodic Backup: OFF Placeholders: OFF Scintilla Rendering Mode: SC_TECHNOLOGY_DEFAULT (0) Multi-instance Mode: monoInst asNotepad: OFF File Status Auto-Detection: cdEnabledNew (for current file/tab only) Dark Mode: ON Display Info: primary monitor: 1920x1080, scaling 100% visible monitors count: 3 installed Display Class adapters: 0000: Description - Intel(R) Iris(R) Xe Graphics 0000: DriverVersion - 32.0.101.7077 0001: Description - Microsoft Remote Display Adapter 0001: DriverVersion - 10.0.19041.5794 0002: Description - Microsoft Remote Display Adapter 0002: DriverVersion - 10.0.19041.5794 OS Name: Windows 10 Pro (64-bit) OS Version: 22H2 OS Build: 19045.6456 Current ANSI codepage: 1252 Plugins: ComparePlus (2.2) ElasticTabstops (1.5) JSMinNPP (1.2312) mimeTools (3.1) NppConverter (4.7) NppExport (0.4) PlantUMLViewer (1.9.0.13) PythonScript (2) XMLTools (3.1.1.13) -
@dfs said in Dark Mode style for UDL:
I wondered if it is possible to modify the style for the dark mode the same way it works for the included languages
You define two separate UDL (two separate files), one with your light colors, one with your dark colors. Then, as is done in markdown._preinstalled_DM.udl.xml (which comes preinstalled when you get N++), you set
darkModeTheme="yes":<UserLang name="Markdown (preinstalled dark mode)" ext="md markdown" darkModeTheme="yes" udlVersion="2.1">(yours would, of course, have the name and extensions appropriate for your UDL)
When you have both those UDL in Notepad++, then when it’s in Dark Mode, it will use the settings from the UDL with
darkModeTheme="yes", and when in Light Mode, it will use the settings from the UDL without that attribute (or with that attribute set to"no", IIRC). -
Thank you @PeterJones, this is a perfect solution.
-
@PeterJones ,
Hmm, I wasn’t aware of that. Now I have to go and experiment. I created the two files, but never thought about that setting as I thought the darkmode setting was in the config.xml and you had to change the environment manually which is why we needed to create two separate files. -
@PeterJones ,
To verify, I’m not sure if that “no” switch is effective or not, but on the 8.9.2 version plain vanilla, I downloaded the dBASE language files and changed just the Dark mode file with thedarkModeThene="yes"switch, and just switching between dark mode and light mode, and opening the same code file in each allowed for the change to take place,magically.Thanks, now I can get rid of my contextMenu.xml hack for switching between the Dark and Light version, and when I finish the other dBASE dialects, they’ll be the only choices I need to put in the contextMenu.xml to switch between them. Because of the same named file extensions and similarity in much of the language syntax in files between them, it may require manually choosing the right version on opening them and the right click will be dedicated to that purpose. Thanks for that info.