How to Customize Themes and Skins for Electron Desktop Apps

    This article explains why most cross-platform desktop clients can be re-skinned: they are built on Electron, so their interfaces are essentially web pages styled with standard CSS. It compares two common approaches—modifying the packaged app resources and injecting custom CSS at runtime through the Chrome DevTools Protocol (CDP)—and introduces a practical launcher script that combines their strengths. You will also find preparation tips, a sample injection script, a CSS variable template, troubleshooting advice, and notes on keeping changes personal and compliant with software terms.

    1. Why Desktop Clients Can Be Re-Skinned

    Over the past few years, AI coding tools, AI chat clients, and various Agent desktop apps have spread quickly. An interesting trend has emerged: many users customize these clients with personalized themes, and some even sell their self-made skins on second-hand marketplaces. Behind this trend is a public technical fact—most cross-platform desktop clients are built on the same kind of technology stack.

    These apps are typically developed with the Electron framework. Electron’s core idea is to bundle a browser engine with a local runtime into the installer, so the frontend pages run inside the app’s own window. As a result, the interface is essentially a web page, the stylesheets are ordinary CSS, and every button, sidebar, and input field you see is a DOM node.

    This leads to two direct outcomes:

    • The apps generally keep a developer tools entry point, which can usually be opened with a keyboard shortcut, allowing real-time frontend debugging.
    • The styles and structure are fully readable and editable. With enough patience, you can adjust the interface to any look you want.

    It is worth emphasizing that this article focuses only on local visual customization. It does not involve bypassing licensing, cracking paid features, or tampering with business logic. Make sure your modifications are for personal use only and comply with the software’s terms of service.

    2. Two Mainstream Technical Approaches

    There are generally two common ways to modify a theme skin.

    Approach 1: Directly Modify the Packaged Resources

    Electron apps package frontend resources into archive files. Once unpacked, you can see HTML, CSS, JS, and image assets. You can unpack the archive, append a custom stylesheet, and repack it so the changes take effect permanently.

    The advantage is that it lasts: the changes remain after a restart. The downside is the higher barrier to entry, and once the app is upgraded and the installer is overwritten, all changes are lost and must be redone. In addition, some apps perform resource integrity checks, and repacking may prevent them from launching.

    Approach 2: Runtime CSS Injection (CDP Injection)

    This approach does not modify any files. Instead, after the app starts, it injects a piece of CSS into the renderer process through the debugging protocol. The principle is straightforward: the browser engine exposes a debugging protocol interface, so you can use a script to connect to the target renderer process and then issue style injection commands.

    The advantage is zero intrusion: it can be toggled on and off at any time and still works after upgrades. The downside is that it must be re-injected on every launch and is not persistent.

    A Compromise: Write a Launcher Script

    The most practical way to offset the drawbacks of both approaches is to write a launcher. Instead of double-clicking the app icon, the user runs your script. The script launches the app, waits for the window to be ready, connects to the debugging port, injects the styles, and then exits. The whole process is completely transparent to the user and does not break after an upgrade.

    This approach works the same way on Windows and macOS, and it is not limited to a specific tool. Any client built on the same kind of technology stack can reuse it.

    3. Preparation Before You Start

    1. Confirm the technology stack. The most direct way is to open the developer tools. If you can see the element tree and the style panel, it is almost certainly rendered by a browser engine.
    2. Prepare a style draft. Try changes in the developer tools first, and save them to a file once you are satisfied with the result.
    3. Define the scope of changes. It is recommended to override only visual variables such as colors, border radii, spacing, shadows, and fonts, and not to change the layout structure, to avoid affecting usability.
    4. Make a backup. If you choose the repacking route, be sure to copy the original archive first.

    4. Practice: Building Your Own Theme from Scratch

    Below is an injection script skeleton you can apply directly, for illustration only:

    1. // inject-theme.js —— Inject custom CSS through the debugging protocol
    2. const http = require('http');
    3. const fs = require('fs');
    4. const PORT = 9222; // Debugging port
    5. const css = fs.readFileSync('./theme.css', 'utf8');
    6. function getTarget() {
    7. return new Promise((resolve, reject) => {
    8. http.get(`http://127.0.0.1:${PORT}/json`, res => {
    9. let buf = '';
    10. res.on('data', d => buf += d);
    11. res.on('end', () => {
    12. const list = JSON.parse(buf);
    13. const page = list.find(t => t.type === 'page');
    14. page ? resolve(page) : reject(new Error('Page target not found'));
    15. });
    16. }).on('error', reject);
    17. });
    18. }
    19. (async () => {
    20. const target = await getTarget();
    21. const ws = new WebSocket(target.webSocketDebuggerUrl);
    22. ws.onopen = () => {
    23. ws.send(JSON.stringify({ id: 1, method: 'Runtime.evaluate', params: {
    24. expression: `(() => { const s = document.createElement('style');
    25. s.textContent = ${JSON.stringify(css)};
    26. document.head.appendChild(s); })()`
    27. }}));
    28. };
    29. })();

    The accompanying stylesheet can first consolidate everything with CSS variables for easier maintenance later:

    1. :root {
    2. --app-bg: #0f1115;
    3. --panel-bg: #171a21;
    4. --text-main: #e6e8eb;
    5. --accent: #4c8bf5;
    6. --radius: 10px;
    7. }

    The actual process is often iterative: first set the primary color and background, then adjust the sidebar and card hierarchy, then handle details such as scrollbars, selected states, and hover states, and finally unify border radii and shadows. In between, you may go through a dozen or even dozens of rounds of conversation with an Agent assistant, having it generate selectors, fix specificity conflicts, and fill in missed components. The changes can be light, just a new color scheme, or deep, reworking the visual hierarchy.

    5. Common Issues and Troubleshooting

    • Injection has no effect: this is usually because the selector specificity is not high enough. Increase the selector weight or append !important.
    • Stops working after an upgrade: the repacking route will inevitably break, while the injection route is unaffected.
    • Cannot open developer tools: some apps disable this entry point. Try launching with debugging parameters.
    • Style flickering: inject after the page-ready event to reduce first-screen jitter.

    6. Conclusion

    The essence of re-skinning is understanding the fact that “a desktop app is a web page” and making good use of the two basic tools: the debugging protocol and stylesheets. Once you master this, you can not only transform the interface but also transfer this methodology to any similar client. Instead of paying a high price for ready-made skins, build your own and tune the tool to the way you work best—that is the real joy of customization.