Salesforce Certified Platform User Experience Designer Practice Questions

Salesforce Certified Platform User Experience Designer exam preparation

Salesforce Certified Platform User Experience Designer practice questions in English: 180 questions with explanations. The mock exam has 60 questions and 105 minutes.

Salesforce Certified Platform User Experience Designer free question 10 / 10 · Domain 6: Salesforce Lightning Design System (SLDS)

A developer builds a new component whose block class is .slds-media-card. The component has a header part and a compact variation. Which pair of class names follows the Lightning Design System naming?

  1. .slds-media-card__header for the part and .slds-media-card__compact for the variation
  2. .slds-media-card__header for the part and .slds-media-card_compact for the variation
  3. .slds-media-card_header for the part and .slds-media-card__compact for the variation
  4. .slds-media-card-header for the part and .slds-media-card_compact for the variation
Show the answer and explanation

Answer: B

Why this is correct
The Markup and Style page builds on BEM. A block is the main component name, an element is a part of the component separated by two underscores, and a modifier is a variation of the component or of an element separated by a single underscore. The header part is therefore .slds-media-card__header and the compact variation is .slds-media-card_compact, which is added next to the base class.

Why the other options are wrong
".slds-media-card-header for the part and .slds-media-card_compact for the variation" … A single dash does not mean an element in BEM. The page says a single dash can be used for compound naming only, so a header part needs the double underscore to show that it belongs to the block.
".slds-media-card__header for the part and .slds-media-card__compact for the variation" … The variation uses two underscores here. The page gives modifiers a single underscore, and its example adds a modifier next to the base class, as in .house_gray beside .house.
".slds-media-card_header for the part and .slds-media-card__compact for the variation" … The two separators are swapped. The page gives the double underscore to elements and the single underscore to modifiers, so the part would be written with two underscores and the variation with one.

Underscores carry meaning
The page's house example uses .house as the block, .house__door as an element, and .house_gray as a modifier. It says to avoid names such as .house__stair__step and to use .house__stair-step instead.

Go to the Salesforce Certified Platform User Experience Designer practice app (10 free questions; purchase unlocks all questions)

See the full practice set