ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 82 - Certified User Experience Designer discussion

Report
Export

A developer is creating a Lightning Web Component (LWC) and wants to make sure the visual experience is consistent with Cloud Kicks' branding. The developer asks their UX Designer about the Salesforce Lightning Design System (SLDS) stylinghooks.

How should the designer describe them?

A.
They use standard CSS properties to directly style HTML elements.
Answers
A.
They use standard CSS properties to directly style HTML elements.
B.
They use standard CSS properties to easily style base and custom components.
Answers
B.
They use standard CSS properties to easily style base and custom components.
C.
They use custom CSS properties to directly style HTML elements.
Answers
C.
They use custom CSS properties to directly style HTML elements.
D.
They use custom CSS properties to easily style base and custom components.
Answers
D.
They use custom CSS properties to easily style base and custom components.
Suggested answer: D

Explanation:

Styling hooks are CSS custom properties that allow developers to customize the appearance of base and custom components in a consistent and supported way. They work with web components and shadow DOM, which provide encapsulation and modularity for LWC. Styling hooks use the--sldsnamespace and follow a naming convention that reflects the component, category, property, attribute, and state of the element being styled. For example,--slds-c-button-brand-color-background-hoveris a styling hook for the button component, brand category, color background property, and hover state. Styling hooks can be declared in the CSS file of the LWC or in a global CSS file that affects all components on the page. Styling hooks are not standard CSS properties, but custom ones that are defined by SLDS and applied to the components using thevar()function.Reference:

Styling Hooks - Lightning Design System

SLDS Styling Hooks | Lightning Web Components Developer Guide | Salesforce Developers

--dxp Styling Hooks | LWR Sites for Experience Cloud | Salesforce Developers

The Salesforce Lightning Design System (SLDS) styling hooks use standard CSS properties to easily style base and custom components. Salesforce documentation states that ''SLDS styling hooks are CSS classes that give you access to the same styling used in the Salesforce Lightning Design System. They make it easy to style base and custom components with the same look and feel'' [1].

[1]https://developer.salesforce.com/docs/component-library/documentation/lwc/lwc.use_slds_styling_hooks

asked 23/09/2024
Lee, Eduardo
48 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first