Services Work About Contact Resources Start a Project →
SLDS FAQ

Salesforce Lightning Design System questions, answered.

A practical guide to using SLDS without fighting it—and to knowing when custom CSS or an LWC is the better engineering choice.

What is SLDS?
Salesforce Lightning Design System (SLDS) is a design system providing UI patterns, styling guidance, accessibility considerations and reusable visual conventions for Salesforce experiences.
Why use SLDS for LWC development?
SLDS helps custom LWCs feel native to Salesforce and provides consistent patterns for spacing, typography, grids, forms, buttons and responsive layouts. It also reduces the need to invent every visual rule from scratch.
Can I use custom CSS with SLDS?
Yes. A practical implementation often combines SLDS utility and component patterns with scoped custom CSS for project-specific requirements. The goal is controlled customization, not overriding every Salesforce convention.
Why does my SLDS layout break on mobile?
Common causes include fixed widths, long labels, inflexible grids, dense tables, absolute positioning or assumptions about desktop space. Responsive SLDS implementation requires testing actual content and defining how each component changes at smaller widths.
How do I customize an SLDS component?
First use supported classes, variants and component properties. If that is insufficient, build a custom LWC that reproduces the required interaction using SLDS patterns rather than depending on unsupported internal markup overrides.
Can I override Salesforce standard component styles?
Only use supported styling mechanisms where available. Deep selectors, global CSS and DOM manipulation against internal implementation details can break when Salesforce changes the component. A custom component is often more maintainable.
How do I match a Figma design using SLDS?
Map the design to existing SLDS patterns first, then identify genuine gaps. Translate spacing, typography, states and responsive behavior into reusable tokens and component rules instead of copying pixel values into isolated elements.
Should every Salesforce page use the same SLDS patterns?
Consistency is valuable, but not every screen has the same information density or workflow. Use shared patterns as a foundation while adapting layouts to the user task and content.
How do I handle spacing consistently with SLDS?
Use the system’s established spacing utilities and project-level tokens where possible. Avoid arbitrary margin values scattered across components because they make visual consistency and later redesigns harder.
How do I make SLDS forms responsive?
Use flexible grids, sensible field widths and stacked layouts at smaller breakpoints. Long labels, validation messages and help text should be included in responsive testing because they often expose layout weaknesses.
Is SLDS only for Salesforce standard pages?
No. SLDS patterns can inform custom LWCs and Salesforce experiences, including Experience Cloud, where the implementation supports the required design system and accessibility needs.
Why does my custom CSS look different from standard Salesforce UI?
Differences can come from typography, spacing, border treatment, component states or missing SLDS patterns. Comparing the implementation against the intended design system usually reveals whether the issue is CSS, markup structure or inconsistent tokens.
How can I avoid CSS conflicts in LWC?
Keep styles scoped to the component, use clear class names, minimize broad selectors and avoid assumptions about another component’s DOM. Shared styling should be deliberate and based on supported Salesforce mechanisms.
How important is accessibility when using SLDS?
Very important. SLDS provides patterns that can help, but developers still need to implement semantic structure, labels, keyboard behavior, focus states, contrast and dynamic feedback correctly.
When should I stop trying to force SLDS and build a custom UI?
When the desired interaction or visual structure repeatedly fights supported SLDS patterns, creates brittle overrides or produces poor responsive behavior. A focused custom LWC can be cleaner and easier to maintain.

Still stuck with a Salesforce UI problem?

Bring the existing interface, error, Figma design or technical requirement. WebCraftStudio can help diagnose the issue and turn the fix into production-ready Salesforce UI.

Explore LWC + SLDS Development → Start a Project →