@salesforce/mcp-provider-lwc-experts 0.6.3 → 0.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.bundle.js +109 -117
- package/knowledge/graphql/generation-guide.md +212 -0
- package/knowledge/graphql/generation-mutation.md +265 -0
- package/knowledge/graphql/generation-query.md +235 -0
- package/knowledge/graphql/generation-schema.md +20 -0
- package/knowledge/graphql/schema/shared.graphqls +1140 -0
- package/knowledge/o11y/activityApi.md +64 -0
- package/knowledge/o11y/bestPractices.md +106 -0
- package/knowledge/o11y/counterMetrics.md +61 -0
- package/knowledge/o11y/errorTracking.md +70 -0
- package/knowledge/o11y/initialization.md +46 -0
- package/knowledge/o11y/lifecycleInstrumentation.md +91 -0
- package/knowledge/o11y/logApi.md +53 -0
- package/knowledge/o11y/schemaUsage.md +48 -0
- package/knowledge/slds/styling-hooks/README.md +408 -0
- package/knowledge/slds/styling-hooks/categories/color.md +963 -0
- package/knowledge/slds/styling-hooks/categories/radius.md +526 -0
- package/knowledge/slds/styling-hooks/categories/shadow.md +489 -0
- package/knowledge/slds/styling-hooks/categories/sizing.md +667 -0
- package/knowledge/slds/styling-hooks/categories/spacing.md +501 -0
- package/knowledge/slds/styling-hooks/categories/typography.md +708 -0
- package/knowledge/slds/styling-hooks/global-semantic/accent-hooks.md +207 -0
- package/knowledge/slds/styling-hooks/global-semantic/feedback-hooks.md +819 -0
- package/knowledge/slds/styling-hooks/global-semantic/surface-hooks.md +215 -0
- package/knowledge/slds/styling-hooks/guidance.md +906 -0
- package/knowledge/slds/styling-hooks/metadata/hooks-index.json +6576 -0
- package/knowledge/utam/generation-guide.md +499 -0
- package/knowledge/utam/generation-workflow.md +243 -0
- package/knowledge/utam/namespaces-mapping.md +26 -0
- package/knowledge/utam/utam-json-schema.md +720 -0
- package/knowledge/utils.ts +27 -0
- package/package.json +4 -3
- /package/{agents → experts}/lds/resources/lwc/guides/reference/reference-create-list-info.md +0 -0
- /package/{agents → experts}/lds/resources/lwc/guides/reference/reference-create-record.md +0 -0
- /package/{agents → experts}/lds/resources/lwc/guides/reference/reference-delete-list-info.md +0 -0
- /package/{agents → experts}/lds/resources/lwc/guides/reference/reference-delete-record.md +0 -0
- /package/{agents → experts}/lds/resources/lwc/guides/reference/reference-get-list-info-by-name.md +0 -0
- /package/{agents → experts}/lds/resources/lwc/guides/reference/reference-get-list-infos-by-name.md +0 -0
- /package/{agents → experts}/lds/resources/lwc/guides/reference/reference-get-list-infos-by-object-name.md +0 -0
- /package/{agents → experts}/lds/resources/lwc/guides/reference/reference-get-list-object-info.md +0 -0
- /package/{agents → experts}/lds/resources/lwc/guides/reference/reference-get-list-preferences.md +0 -0
- /package/{agents → experts}/lds/resources/lwc/guides/reference/reference-get-list-records-by-name.md +0 -0
- /package/{agents → experts}/lds/resources/lwc/guides/reference/reference-update-list-info.md +0 -0
- /package/{agents → experts}/lds/resources/lwc/guides/reference/reference-update-list-preferences.md +0 -0
- /package/{agents → experts}/lds/resources/lwc/guides/reference/reference-update-record.md +0 -0
- /package/{agents → experts}/lds/resources/lwc/guides/reference/wire-adapters/lds-wire-adapter-types.json +0 -0
- /package/{agents → experts}/lds/resources/lwc/guides/reference/wire-adapters/reference-wire-adapters-get-related-list-count.md +0 -0
- /package/{agents → experts}/lds/resources/lwc/guides/reference/wire-adapters/reference-wire-adapters-get-related-list-info-batch.md +0 -0
- /package/{agents → experts}/lds/resources/lwc/guides/reference/wire-adapters/reference-wire-adapters-get-related-list-info.md +0 -0
- /package/{agents → experts}/lds/resources/lwc/guides/reference/wire-adapters/reference-wire-adapters-get-related-list-records-batch.md +0 -0
- /package/{agents → experts}/lds/resources/lwc/guides/reference/wire-adapters/reference-wire-adapters-get-related-list-records.md +0 -0
- /package/{agents → experts}/lds/resources/lwc/guides/reference/wire-adapters/reference-wire-adapters-get-related-lists-info.md +0 -0
- /package/{agents → experts}/lds/resources/lwc/guides/reference/wire-adapters/reference-wire-adapters-object-info.md +0 -0
- /package/{agents → experts}/lds/resources/lwc/guides/reference/wire-adapters/reference-wire-adapters-object-infos.md +0 -0
- /package/{agents → experts}/lds/resources/lwc/guides/reference/wire-adapters/reference-wire-adapters-picklist-values-record.md +0 -0
- /package/{agents → experts}/lds/resources/lwc/guides/reference/wire-adapters/reference-wire-adapters-picklist-values.md +0 -0
- /package/{agents → experts}/lds/resources/lwc/guides/reference/wire-adapters/reference-wire-adapters-record.md +0 -0
- /package/{agents → experts}/lds/resources/lwc/guides/reference/wire-adapters/reference-wire-adapters-records.md +0 -0
|
@@ -0,0 +1,489 @@
|
|
|
1
|
+
# SLDS Shadow Styling Hooks
|
|
2
|
+
|
|
3
|
+
**Category:** Visual Effects / Elevation
|
|
4
|
+
**Total Hooks:** 39 shadow-related hooks
|
|
5
|
+
**Purpose:** Create depth, elevation, and visual hierarchy through shadows
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
Shadow styling hooks provide consistent elevation and depth effects across SLDS components. Shadows help establish visual hierarchy, indicate interactive elements, and create the perception of layered content.
|
|
12
|
+
|
|
13
|
+
**Key Principles:**
|
|
14
|
+
|
|
15
|
+
- Use shadows to indicate elevation and interactivity
|
|
16
|
+
- Higher numbered shadows (1→6) indicate greater elevation
|
|
17
|
+
- Directional shadows control shadow placement (block/inline)
|
|
18
|
+
- Focus shadows indicate keyboard interaction states
|
|
19
|
+
- Maintain consistency in shadow usage across similar components
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Core Shadow Hooks (`--slds-g-shadow-*`)
|
|
24
|
+
|
|
25
|
+
### Available Hooks
|
|
26
|
+
|
|
27
|
+
| Hook | Value | Description |
|
|
28
|
+
| ------------------- | -------------------------------------------------------------------------------------------- | ----------------------------------- |
|
|
29
|
+
| `--slds-g-shadow-1` | `0px 0px 1.5px 0px #00000017, 0px 1.4px 1.5px 0px #00000017, 0px -1px 1px 0px #00000009` | Minimal elevation - subtle shadow |
|
|
30
|
+
| `--slds-g-shadow-2` | `0px 0px 3px 0px #00000016, 0px 2.8px 3px 0px #00000016, 0px -1px 1.2px 0px #00000009` | Low elevation - slight lift |
|
|
31
|
+
| `--slds-g-shadow-3` | `0px 0px 4.5px 0px #00000014, 0px 4.2px 4.5px 0px #00000017, 0px -1px 1.44px 0px #00000008` | Medium elevation - clear separation |
|
|
32
|
+
| `--slds-g-shadow-4` | `0px 0px 6.75px 0px #00000012, 0px 6.3px 6.75px 0px #00000012, 0px -1px 1.7px 0px #00000007` | High elevation - prominent lift |
|
|
33
|
+
| `--slds-g-shadow-5` | Complex value | Higher elevation |
|
|
34
|
+
| `--slds-g-shadow-6` | Complex value | Maximum elevation |
|
|
35
|
+
|
|
36
|
+
### Usage Guidance
|
|
37
|
+
|
|
38
|
+
#### Shadow-1: Minimal Elevation
|
|
39
|
+
|
|
40
|
+
**Use For:**
|
|
41
|
+
|
|
42
|
+
- Subtle card separation
|
|
43
|
+
- Low-priority containers
|
|
44
|
+
- Flat designs with minimal depth
|
|
45
|
+
|
|
46
|
+
```css
|
|
47
|
+
.card-minimal {
|
|
48
|
+
box-shadow: var(--slds-g-shadow-1);
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
#### Shadow-2: Low Elevation
|
|
53
|
+
|
|
54
|
+
**Use For:**
|
|
55
|
+
|
|
56
|
+
- Standard cards
|
|
57
|
+
- List items with slight separation
|
|
58
|
+
- Subtle hover states
|
|
59
|
+
|
|
60
|
+
```css
|
|
61
|
+
.card-default {
|
|
62
|
+
box-shadow: var(--slds-g-shadow-2);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.card-default:hover {
|
|
66
|
+
box-shadow: var(--slds-g-shadow-3);
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
#### Shadow-3: Medium Elevation
|
|
71
|
+
|
|
72
|
+
**Use For:**
|
|
73
|
+
|
|
74
|
+
- Elevated cards
|
|
75
|
+
- Dropdown menus
|
|
76
|
+
- Popovers
|
|
77
|
+
- Hover states from shadow-2
|
|
78
|
+
|
|
79
|
+
```css
|
|
80
|
+
.dropdown-menu {
|
|
81
|
+
box-shadow: var(--slds-g-shadow-3);
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
#### Shadow-4: High Elevation
|
|
86
|
+
|
|
87
|
+
**Use For:**
|
|
88
|
+
|
|
89
|
+
- Modals
|
|
90
|
+
- Dialogs
|
|
91
|
+
- Floating action buttons
|
|
92
|
+
- Critical overlays
|
|
93
|
+
|
|
94
|
+
```css
|
|
95
|
+
.modal {
|
|
96
|
+
box-shadow: var(--slds-g-shadow-4);
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
#### Shadow-5 & Shadow-6: Maximum Elevation
|
|
101
|
+
|
|
102
|
+
**Use For:**
|
|
103
|
+
|
|
104
|
+
- Maximum emphasis overlays
|
|
105
|
+
- Top-level dialogs
|
|
106
|
+
- Critical alerts requiring immediate attention
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## Directional Shadow Hooks
|
|
111
|
+
|
|
112
|
+
### Block Direction (Vertical)
|
|
113
|
+
|
|
114
|
+
Control shadow placement along the vertical axis:
|
|
115
|
+
|
|
116
|
+
| Hook | Description |
|
|
117
|
+
| ------------------------------ | ------------------------------- |
|
|
118
|
+
| `--slds-g-shadow-blockstart-1` | Shadow at top edge (level 1) |
|
|
119
|
+
| `--slds-g-shadow-blockstart-2` | Shadow at top edge (level 2) |
|
|
120
|
+
| `--slds-g-shadow-blockstart-3` | Shadow at top edge (level 3) |
|
|
121
|
+
| `--slds-g-shadow-blockstart-4` | Shadow at top edge (level 4) |
|
|
122
|
+
| `--slds-g-shadow-blockend-1` | Shadow at bottom edge (level 1) |
|
|
123
|
+
| `--slds-g-shadow-blockend-2` | Shadow at bottom edge (level 2) |
|
|
124
|
+
| `--slds-g-shadow-blockend-3` | Shadow at bottom edge (level 3) |
|
|
125
|
+
| `--slds-g-shadow-blockend-4` | Shadow at bottom edge (level 4) |
|
|
126
|
+
|
|
127
|
+
**Use Cases:**
|
|
128
|
+
|
|
129
|
+
- Fixed headers with shadow at bottom (blockend)
|
|
130
|
+
- Floating elements with shadow at top (blockstart)
|
|
131
|
+
- Sticky navigation bars
|
|
132
|
+
|
|
133
|
+
```css
|
|
134
|
+
.fixed-header {
|
|
135
|
+
box-shadow: var(--slds-g-shadow-blockend-2);
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Inline Direction (Horizontal)
|
|
140
|
+
|
|
141
|
+
Control shadow placement along the horizontal axis:
|
|
142
|
+
|
|
143
|
+
| Hook | Description |
|
|
144
|
+
| ------------------------------- | ------------------------------ |
|
|
145
|
+
| `--slds-g-shadow-inlinestart-1` | Shadow at start edge (level 1) |
|
|
146
|
+
| `--slds-g-shadow-inlinestart-2` | Shadow at start edge (level 2) |
|
|
147
|
+
| `--slds-g-shadow-inlinestart-3` | Shadow at start edge (level 3) |
|
|
148
|
+
| `--slds-g-shadow-inlinestart-4` | Shadow at start edge (level 4) |
|
|
149
|
+
| `--slds-g-shadow-inlineend-1` | Shadow at end edge (level 1) |
|
|
150
|
+
| `--slds-g-shadow-inlineend-2` | Shadow at end edge (level 2) |
|
|
151
|
+
| `--slds-g-shadow-inlineend-3` | Shadow at end edge (level 3) |
|
|
152
|
+
| `--slds-g-shadow-inlineend-4` | Shadow at end edge (level 4) |
|
|
153
|
+
|
|
154
|
+
**Use Cases:**
|
|
155
|
+
|
|
156
|
+
- Side navigation panels
|
|
157
|
+
- Slide-out drawers
|
|
158
|
+
- Edge-aligned popovers
|
|
159
|
+
|
|
160
|
+
```css
|
|
161
|
+
.side-panel-right {
|
|
162
|
+
box-shadow: var(--slds-g-shadow-inlinestart-3);
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## Focus Shadow Hooks
|
|
169
|
+
|
|
170
|
+
Indicate keyboard focus states with accessible shadows:
|
|
171
|
+
|
|
172
|
+
| Hook | Description |
|
|
173
|
+
| -------------------------------------- | -------------------------- |
|
|
174
|
+
| `--slds-g-shadow-outline-focus-1` | Outline-style focus shadow |
|
|
175
|
+
| `--slds-g-shadow-outset-focus-1` | Outset focus shadow |
|
|
176
|
+
| `--slds-g-shadow-inset-focus-1` | Inset focus shadow |
|
|
177
|
+
| `--slds-g-shadow-insetinverse-focus-1` | Inset inverse focus shadow |
|
|
178
|
+
|
|
179
|
+
### Usage Patterns
|
|
180
|
+
|
|
181
|
+
#### Outline Focus (Most Common)
|
|
182
|
+
|
|
183
|
+
For standard interactive elements:
|
|
184
|
+
|
|
185
|
+
```css
|
|
186
|
+
.button:focus {
|
|
187
|
+
outline: none;
|
|
188
|
+
box-shadow: var(--slds-g-shadow-outline-focus-1);
|
|
189
|
+
}
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
#### Outset Focus
|
|
193
|
+
|
|
194
|
+
For elements with existing shadows:
|
|
195
|
+
|
|
196
|
+
```css
|
|
197
|
+
.card-interactive:focus {
|
|
198
|
+
box-shadow: var(--slds-g-shadow-2), var(--slds-g-shadow-outset-focus-1);
|
|
199
|
+
}
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
#### Inset Focus
|
|
203
|
+
|
|
204
|
+
For input fields and contained elements:
|
|
205
|
+
|
|
206
|
+
```css
|
|
207
|
+
.input-field:focus {
|
|
208
|
+
box-shadow: var(--slds-g-shadow-inset-focus-1);
|
|
209
|
+
}
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
#### Inverse Focus
|
|
213
|
+
|
|
214
|
+
For elements on dark backgrounds:
|
|
215
|
+
|
|
216
|
+
```css
|
|
217
|
+
.dark-mode .button:focus {
|
|
218
|
+
box-shadow: var(--slds-g-shadow-insetinverse-focus-1);
|
|
219
|
+
}
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
## Inverse Shadow Hook
|
|
225
|
+
|
|
226
|
+
| Hook | Description |
|
|
227
|
+
| --------------------------- | -------------------------------------- |
|
|
228
|
+
| `--slds-g-shadow-inverse-1` | Shadow for dark mode/inverted contexts |
|
|
229
|
+
|
|
230
|
+
**Use For:**
|
|
231
|
+
|
|
232
|
+
- Dark mode UI elements
|
|
233
|
+
- Inverted color schemes
|
|
234
|
+
- Light elements on dark backgrounds
|
|
235
|
+
|
|
236
|
+
```css
|
|
237
|
+
.dark-theme .card {
|
|
238
|
+
background: var(--slds-g-color-surface-inverse-1);
|
|
239
|
+
box-shadow: var(--slds-g-shadow-inverse-1);
|
|
240
|
+
}
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
## Best Practices
|
|
246
|
+
|
|
247
|
+
### ✅ DO:
|
|
248
|
+
|
|
249
|
+
1. **Use progressive elevation for hierarchy**
|
|
250
|
+
|
|
251
|
+
```css
|
|
252
|
+
.card {
|
|
253
|
+
box-shadow: var(--slds-g-shadow-2);
|
|
254
|
+
}
|
|
255
|
+
.card:hover {
|
|
256
|
+
box-shadow: var(--slds-g-shadow-3);
|
|
257
|
+
}
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
2. **Combine shadows with focus states**
|
|
261
|
+
|
|
262
|
+
```css
|
|
263
|
+
.interactive:focus {
|
|
264
|
+
box-shadow: var(--slds-g-shadow-2), var(--slds-g-shadow-outline-focus-1);
|
|
265
|
+
}
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
3. **Use directional shadows for edge placement**
|
|
269
|
+
|
|
270
|
+
```css
|
|
271
|
+
.sticky-header {
|
|
272
|
+
box-shadow: var(--slds-g-shadow-blockend-2);
|
|
273
|
+
}
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
4. **Match shadow intensity to component importance**
|
|
277
|
+
- Subtle cards: shadow-1 or shadow-2
|
|
278
|
+
- Dropdowns/popovers: shadow-3
|
|
279
|
+
- Modals/dialogs: shadow-4
|
|
280
|
+
|
|
281
|
+
### ❌ DON'T:
|
|
282
|
+
|
|
283
|
+
1. **Don't mix shadow levels inconsistently**
|
|
284
|
+
|
|
285
|
+
```css
|
|
286
|
+
/* Bad: Jumping from 1 to 4 */
|
|
287
|
+
.card {
|
|
288
|
+
box-shadow: var(--slds-g-shadow-1);
|
|
289
|
+
}
|
|
290
|
+
.card:hover {
|
|
291
|
+
box-shadow: var(--slds-g-shadow-4);
|
|
292
|
+
}
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
2. **Don't use high elevation for minor elements**
|
|
296
|
+
|
|
297
|
+
```css
|
|
298
|
+
/* Bad: Excessive shadow for simple element */
|
|
299
|
+
.label {
|
|
300
|
+
box-shadow: var(--slds-g-shadow-4);
|
|
301
|
+
}
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
3. **Don't hard-code shadow values**
|
|
305
|
+
|
|
306
|
+
```css
|
|
307
|
+
/* Bad */
|
|
308
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
309
|
+
|
|
310
|
+
/* Good */
|
|
311
|
+
box-shadow: var(--slds-g-shadow-2);
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
4. **Don't forget focus states**
|
|
315
|
+
|
|
316
|
+
```css
|
|
317
|
+
/* Bad: No focus shadow */
|
|
318
|
+
.button:focus {
|
|
319
|
+
outline: none;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/* Good */
|
|
323
|
+
.button:focus {
|
|
324
|
+
outline: none;
|
|
325
|
+
box-shadow: var(--slds-g-shadow-outline-focus-1);
|
|
326
|
+
}
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
---
|
|
330
|
+
|
|
331
|
+
## Common Patterns
|
|
332
|
+
|
|
333
|
+
### Pattern 1: Card with Hover Effect
|
|
334
|
+
|
|
335
|
+
```css
|
|
336
|
+
.card {
|
|
337
|
+
background: var(--slds-g-color-surface-container-1);
|
|
338
|
+
border-radius: var(--slds-g-radius-border-1);
|
|
339
|
+
box-shadow: var(--slds-g-shadow-2);
|
|
340
|
+
transition: box-shadow 0.2s ease;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
.card:hover {
|
|
344
|
+
box-shadow: var(--slds-g-shadow-3);
|
|
345
|
+
}
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
### Pattern 2: Dropdown Menu
|
|
349
|
+
|
|
350
|
+
```css
|
|
351
|
+
.dropdown {
|
|
352
|
+
background: var(--slds-g-color-surface-container-1);
|
|
353
|
+
border: 1px solid var(--slds-g-color-border-1);
|
|
354
|
+
border-radius: var(--slds-g-radius-border-2);
|
|
355
|
+
box-shadow: var(--slds-g-shadow-3);
|
|
356
|
+
}
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
### Pattern 3: Modal Dialog
|
|
360
|
+
|
|
361
|
+
```css
|
|
362
|
+
.modal {
|
|
363
|
+
background: var(--slds-g-color-surface-1);
|
|
364
|
+
border-radius: var(--slds-g-radius-border-2);
|
|
365
|
+
box-shadow: var(--slds-g-shadow-4);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
.modal-backdrop {
|
|
369
|
+
background: rgba(0, 0, 0, 0.5);
|
|
370
|
+
}
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
### Pattern 4: Interactive Button with Focus
|
|
374
|
+
|
|
375
|
+
```css
|
|
376
|
+
.button {
|
|
377
|
+
background: var(--slds-g-color-accent-container-1);
|
|
378
|
+
color: var(--slds-g-color-on-accent-1);
|
|
379
|
+
border: 1px solid var(--slds-g-color-border-accent-1);
|
|
380
|
+
border-radius: var(--slds-g-radius-border-1);
|
|
381
|
+
box-shadow: var(--slds-g-shadow-1);
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
.button:hover {
|
|
385
|
+
box-shadow: var(--slds-g-shadow-2);
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
.button:focus {
|
|
389
|
+
outline: none;
|
|
390
|
+
box-shadow: var(--slds-g-shadow-1), var(--slds-g-shadow-outline-focus-1);
|
|
391
|
+
}
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
### Pattern 5: Fixed Header
|
|
395
|
+
|
|
396
|
+
```css
|
|
397
|
+
.fixed-header {
|
|
398
|
+
position: fixed;
|
|
399
|
+
top: 0;
|
|
400
|
+
background: var(--slds-g-color-surface-1);
|
|
401
|
+
box-shadow: var(--slds-g-shadow-blockend-2);
|
|
402
|
+
z-index: 100;
|
|
403
|
+
}
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
---
|
|
407
|
+
|
|
408
|
+
## Accessibility
|
|
409
|
+
|
|
410
|
+
### Focus Visibility
|
|
411
|
+
|
|
412
|
+
Always use focus shadows for keyboard navigation:
|
|
413
|
+
|
|
414
|
+
```css
|
|
415
|
+
.interactive-element:focus {
|
|
416
|
+
outline: none; /* Remove default outline */
|
|
417
|
+
box-shadow: var(--slds-g-shadow-outline-focus-1); /* Add SLDS focus shadow */
|
|
418
|
+
}
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
### Color Independence
|
|
422
|
+
|
|
423
|
+
Shadows provide depth cues independent of color, benefiting users with color vision deficiencies.
|
|
424
|
+
|
|
425
|
+
### Reduced Motion
|
|
426
|
+
|
|
427
|
+
Consider users with motion sensitivity when animating shadows:
|
|
428
|
+
|
|
429
|
+
```css
|
|
430
|
+
@media (prefers-reduced-motion: reduce) {
|
|
431
|
+
.card {
|
|
432
|
+
transition: none;
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
---
|
|
438
|
+
|
|
439
|
+
## Complete Hook Reference
|
|
440
|
+
|
|
441
|
+
### All 39 Shadow Hooks:
|
|
442
|
+
|
|
443
|
+
**Main Shadows (6):**
|
|
444
|
+
|
|
445
|
+
- `--slds-g-shadow-1` through `--slds-g-shadow-6`
|
|
446
|
+
- `--slds-g-shadow-inverse-1`
|
|
447
|
+
|
|
448
|
+
**Directional Block Shadows (8):**
|
|
449
|
+
|
|
450
|
+
- `--slds-g-shadow-blockstart-1` through `--slds-g-shadow-blockstart-4`
|
|
451
|
+
- `--slds-g-shadow-blockend-1` through `--slds-g-shadow-blockend-4`
|
|
452
|
+
|
|
453
|
+
**Directional Inline Shadows (8):**
|
|
454
|
+
|
|
455
|
+
- `--slds-g-shadow-inlinestart-1` through `--slds-g-shadow-inlinestart-4`
|
|
456
|
+
- `--slds-g-shadow-inlineend-1` through `--slds-g-shadow-inlineend-4`
|
|
457
|
+
|
|
458
|
+
**Focus Shadows (4):**
|
|
459
|
+
|
|
460
|
+
- `--slds-g-shadow-outline-focus-1`
|
|
461
|
+
- `--slds-g-shadow-outset-focus-1`
|
|
462
|
+
- `--slds-g-shadow-inset-focus-1`
|
|
463
|
+
- `--slds-g-shadow-insetinverse-focus-1`
|
|
464
|
+
|
|
465
|
+
---
|
|
466
|
+
|
|
467
|
+
## Quick Decision Guide
|
|
468
|
+
|
|
469
|
+
**Choose shadow level based on:**
|
|
470
|
+
|
|
471
|
+
- **Shadow-1:** Subtle separation, flat UI
|
|
472
|
+
- **Shadow-2:** Standard cards, default state
|
|
473
|
+
- **Shadow-3:** Elevated elements, dropdowns, hover states
|
|
474
|
+
- **Shadow-4:** Modals, dialogs, critical overlays
|
|
475
|
+
- **Shadow-5/6:** Maximum emphasis
|
|
476
|
+
|
|
477
|
+
**Choose shadow type based on:**
|
|
478
|
+
|
|
479
|
+
- **Standard shadows:** Most elements
|
|
480
|
+
- **Directional shadows:** Fixed/sticky elements with specific edge placement
|
|
481
|
+
- **Focus shadows:** Keyboard navigation states
|
|
482
|
+
- **Inverse shadows:** Dark mode contexts
|
|
483
|
+
|
|
484
|
+
---
|
|
485
|
+
|
|
486
|
+
**References:**
|
|
487
|
+
|
|
488
|
+
- Source: `/source-data/sds-metadata/styling-hooks/globalstylinghooks.metadata.json`
|
|
489
|
+
- SLDS Documentation: [Elevation & Shadow](https://www.lightningdesignsystem.com/2e1ef8501/)
|