SALESFORCE-PD1 User Interface Practice Question
A developer is working with component styling and design tokens in Lightning Web Components. Which TWO practices apply when working with SLDS styling in LWC? (Choose TWO)
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Prefer standard SLDS utility classes over custom hardcoded CSS rules for padding and margins.
SLDS design tokens can be used via var() CSS variables, and standard SLDS classes should be preferred over custom CSS where possible.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use the !important declaration on every CSS rule to bypass Salesforce CSS encapsulation.
Why it's wrong here
Incorrect because overuse of !important violates CSS best practices.
- ✓
Prefer standard SLDS utility classes over custom hardcoded CSS rules for padding and margins.
Why this is correct
Correct because SLDS utility classes ensure consistency and theme adaptability.
- ✗
Write global CSS stylesheets in static resources and include them in every component using standard HTML <link> tags.
Why it's wrong here
Incorrect because global stylesheets bypass encapsulation and are not standard practice for LWC.
- ✗
Override component-internal shadow DOM styles from a parent component's CSS file without styling hooks.
Why it's wrong here
Incorrect because shadow DOM prevents parent styles from leaking into children unless CSS styling hooks are used.
- ✓
Use SLDS design tokens via CSS custom properties (e.g., var(--lwc-spacingMedium)).
Why this is correct
Correct because SLDS tokens are exposed as CSS custom properties.
About these practice questions
Courseiva writes every SALESFORCE-PD1 question from scratch — 493 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed August 2026 · checked against the official Salesforce exam blueprint
This SALESFORCE-PD1 practice question is part of Courseiva's free Salesforce certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SALESFORCE-PD1 exam.