Loading...

With the Winter ’26 release, Salesforce introduced Dark Mode in Lightning Experience. Dark Mode has been introduced as a beta feature in Winter ’26, and at first it was available only for Starter Edition orgs.

It is now rolling out further with Spring ’26 to Professional, Enterprise, and Developer editions.

To use Dark Mode, Salesforce requires an upgrade to Salesforce Lightning Design System 2 (SLDS 2).

This is not just a visual change. It also changes how developers design and build Lightning Web Components (LWC).

What is Dark Mode in Salesforce?

Dark Mode is a UI theme where the background is dark and text is light, instead of the traditional light background.

Salesforce now supports:

Light Mode
Dark Mode
System Default (follows OS theme)

Dark Mode applies across:

Standard Salesforce UI
Lightning pages
Custom LWCs (if built correctly)

If your custom components use fixed colors like white or black, they may not look good in Dark Mode.

Benefits of Dark Mode

  1. Less Eye Strain

Dark Mode is easier on the eyes, especially when working for long hours.

  1. Better Accessibility

Users who are sensitive to bright screens find Dark Mode more comfortable.

  1. Battery Saving

On OLED screens, Dark Mode can reduce battery usage.

  1. Modern User Experience

Dark Mode gives Salesforce a modern and professional look.

How to Enable Dark Mode in Salesforce

Step 1: Log in to Salesforce and Open Setup

Log in to your Salesforce org and make sure you are in Lightning Experience.

Once logged in, click the gear icon in the top-right corner of the screen and choose Setup from the dropdown menu.

image1 3 1

Step 2: Navigate to Themes and Branding

In Setup, use the Quick Find search box to search for Themes and Branding, then select it from the results list.

IMAGE

image2 2 1

Step 3: Edit the Current Theme

From the Salesforce Cosmos theme dropdown, click Edit to modify the active theme settings in Salesforce.

image3 1

Step 4: In the Dark Mode section, select Let users enable dark mode.

image4 2

Step 5: Save and Activate the Theme

image5 2 1

Once the theme is saved and activated, Dark Mode is enabled at the org level. Users can now choose their preferred display mode from their personal settings. To switch to Dark Mode, users need to open their profile menu and select Dark under the Color Mode (Beta) section. The interface will immediately update to the Dark theme.

If users want to return to Light Mode, they can follow the same process and select Light, or choose System to match their device’s default appearance setting.

image6 2 1

Building Theme-Adaptive Lightning Web Components (Light & Dark Mode)

A reusable Lightning Web Component was created to display information about the currently logged-in user, including Name, Email, Username, Profile, Role, and Active status.


This component can be added to any Lightning Record Page, App Page, or Home Page using the Lightning App Builder.

More importantly, the component is designed to be theme-adaptive. It automatically adjusts its appearance when the org switches between Light Mode and Dark Mode, without requiring any JavaScript logic or a manual toggle.

The component uses Salesforce’s getRecord wire adapter to fetch the current user’s data dynamically based on the logged-in user’s Id. This ensures that the component always shows the correct user information, regardless of where it is placed.

To make the UI adapt to Dark Mode, the styling does not rely on hard-coded colors. Instead, it uses Salesforce Lightning Design System (SLDS) 2.0 design tokens, such as surface and text tokens. These tokens are automatically resolved by Salesforce based on the active theme (Light or Dark), which allows the same component to blend naturally with the rest of the Salesforce UI.

LWC CODE:

HTML

Using SLDS 2.0 Design Tokens for Theme Adaptation

To ensure that the Lightning Web Component adapts seamlessly to both Light Mode and Dark Mode, styling is implemented using Salesforce Lightning Design System (SLDS) 2.0 design tokens instead of hard-coded color values.

Tokens such as –slds-g-color-surface-container-1 and –slds-g-color-on-surface-1 are used to define the background and text colors of the component. These tokens automatically resolve to appropriate color values based on the active theme, allowing the same component to render correctly in both light and dark environments. Border and secondary text colors are handled using tokens like –slds-g-color-border-1 and –slds-g-color-on-surface-2, ensuring consistent contrast and readability.

This approach makes the component visually consistent with standard Salesforce UI elements and eliminates the need for separate stylesheets or conditional logic for different themes.

Salesforce provides a wide range of design tokens through the Lightning Design System, covering surfaces, text, borders, spacing, and typography. By leveraging these tokens, developers can build Lightning Web Components that are not only visually aligned with the Salesforce look and feel but are also future-proof and theme-ready by design.

image7 3 1

The component displayed in Light Mode, using light surface colors and dark text to match the standard Salesforce UI.

image8 2 1

The same component displayed in Dark Mode, with background and text colors automatically adapting using SLDS 2.0 design tokens.

Watch Live Demo

https://drive.google.com/file/d/1csm-P2j5jcWN5nyuOlOD_LJ7tcPxiwWZ/view?usp=sharing

Conclusion

Dark Mode in Salesforce is not just a visual enhancement; it requires developers to build components that adapt correctly to different themes.

This implementation demonstrates how Lightning Web Components can be designed to be theme-ready by using SLDS 2.0 design tokens instead of hard-coded styles.

By relying on Salesforce-provided surface and text tokens, the same component works seamlessly in both Light Mode and Dark Mode while maintaining consistency with standard Salesforce UI elements.

This approach improves user experience, ensures accessibility, and future-proofs custom components for evolving Salesforce themes.

Building theme-adaptive components should be considered a best practice for modern Salesforce UI development, especially as Dark Mode adoption continues to grow.

No Data Found.

Related Articles
Orchestrator vs. Traditional Flows

Businesses use Salesforce automation to reduce manual work, improve efficiency, and automate repetitive business processes. Two commonly used automation approaches inside Salesforce are Traditional Flows and Flow Orchestrator. Traditional Flows are mainly used for simple automation tasks such as updating records, sending notifications, creating tasks, and automating business logic. Flow Orchestrator is designed for more […]

Read More
The Rise of Agentic Government_ What Salesforce’s 2026 Insights Mean for the Future of Public Sector AI

Government technology has often been seen as slower to evolve than the private sector. But Salesforce’s latest research challenges that idea in a big way. In fact, the new findings suggest that public sector organizations may now be moving faster than many businesses when it comes to adopting AI agents and preparing for a more […]

Read More
How To Use Email Service in APEX

Managing approvals, updates, and record changes directly from email can significantly improve efficiency within Salesforce workflows. Instead of logging in, navigating records, and manually updating fields, users can simply respond to emails and trigger automated updates using Email Service in APEX. This approach is especially useful for businesses leveraging Salesforce automation and looking to enhance […]

Read More
Design and Implementation of Salesforce Jira Task Integration 1 1

Businesses have been using Salesforce for CRM operations and Jira for Agile project tracking. However, without integration, teams manually update both systems, leading to data inconsistency and inefficiency.This mechanism establishes a real-time integration between Salesforce and Jira, allowing seamless synchronization of tasks and agile board statuses.  A custom Salesforce dashboard was developed that replicates Jira-style […]

Read More
How to Merge and Brand PDF Files in Salesforce Using LWC Visualforce PDF LIB 1

Salesforce developers frequently encounter document automation requirements that go beyond standard Apex-based PDF generation. From merging multiple ContentVersion files to dynamically applying branding like watermarks and headers, traditional server-side approaches often hit Salesforce heap size limits (6MB/12MB), creating performance and scalability challenges. This guide presents a heap-limit-safe PDF merging architecture in Salesforce using Lightning Web […]

Read More
Building a Reusable Popup Modal Architecture in Salesforce LWC 02 1

Modern Salesforce applications frequently rely on popup modals for confirmations, warnings, access control decisions, and destructive actions. However, building modal logic separately inside every Lightning Web Component often leads to duplicated code, inconsistent user experiences, and growing technical debt. This blog introduces a flexible popup modal architecture in Lightning Web Components (LWC) that centralizes modal […]

Read More
Our Location worldwide
Indian Flag India
3rd Floor, A-10, Pegasus Tower, Sector 68, Noida, Uttar Pradesh 201301 +91-1203239658
United States of America Flag USA
333 West Brown Deer Road Unit G – 366 Milwaukee WI, USA 53217 +1(262) 310-7818
United Kingdom Flag UK
7 Bell Yard, London, WC2A 2JR +44 20 3239 9428
Canada Canada
HIC Global Solutions INC
6D - 7398 Yonge St #1124 Thornhill, ON L4J 8J2 Canada +1(262) 310-7818