@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,819 @@
|
|
|
1
|
+
# Feedback Color Styling Hooks
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
**Reference:** [Lightning Design System - Color](https://www.lightningdesignsystem.com/2e1ef8501/p/655b28-color/b/25b51f)
|
|
6
|
+
|
|
7
|
+
Feedback or alert colors provide visual feedback to the user regarding the status of an action or event. These colors are intentionally reserved to convey specific associations throughout the Salesforce UI. Only use feedback colors for their intended meaning so users have clear color associations throughout all of Salesforce products.
|
|
8
|
+
|
|
9
|
+
| **Color** | **Meaning** |
|
|
10
|
+
| --------- | ----------------------------------------------------------- |
|
|
11
|
+
| Error | An error that needs to be addressed before progressing |
|
|
12
|
+
| Warning | A warning of potential issues the user needs to be aware of |
|
|
13
|
+
| Success | A positive or successful action or outcome |
|
|
14
|
+
| Info | Convey non-critical information to users |
|
|
15
|
+
| Disabled | Indicates that a component is unavailable |
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Understanding Feedback Hook Variants
|
|
20
|
+
|
|
21
|
+
### The 1-2 Pattern
|
|
22
|
+
|
|
23
|
+
Feedback hooks that include `-1` and `-2` variants follow this pattern:
|
|
24
|
+
|
|
25
|
+
- **`-1`**: Default state (lighter color, lower emphasis)
|
|
26
|
+
- **`-2`**: Hover/active state OR higher emphasis state (darker color, higher emphasis)
|
|
27
|
+
|
|
28
|
+
### Why Some Feedback Types Lack Variants
|
|
29
|
+
|
|
30
|
+
Not all feedback categories have `-2` variants. This is **intentional** and based on component availability in SLDS2:
|
|
31
|
+
|
|
32
|
+
| Feedback Type | Has `-2` Variant? | Reason |
|
|
33
|
+
| ------------- | -------------------------------------- | -------------------------------------------------------------------------- |
|
|
34
|
+
| Error | ✅ Yes (container, border, on-error) | SLDS2 includes error/destructive buttons requiring hover states |
|
|
35
|
+
| Success | ✅ Yes (container, border, on-success) | SLDS2 includes success buttons requiring hover states |
|
|
36
|
+
| Warning | ❌ No (except border-1) | SLDS2 has no warning buttons; used for form validation and static alerts |
|
|
37
|
+
| Info | ❌ No | SLDS2 has no info buttons; only static badges, icons, and alert containers |
|
|
38
|
+
| Disabled | ✅ Yes (container, on-disabled) | Multiple disabled states for different visual weights |
|
|
39
|
+
|
|
40
|
+
**Future-proofing**: If interactive warning or info components (such as warning buttons) are added to SLDS2 in future releases, corresponding `-2` variants may be introduced for hover states.
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Quick Reference: Hook Selection Guide
|
|
45
|
+
|
|
46
|
+
Use this table to quickly find the right hook for your use case:
|
|
47
|
+
|
|
48
|
+
| Scenario | Hook | Paired With | Example Use Case |
|
|
49
|
+
| -------------------------------------- | ---------------------- | -------------------------------- | --------------------------- |
|
|
50
|
+
| **Error text on neutral background** | `error-1` | neutral surface | Form validation message |
|
|
51
|
+
| **Error alert background** | `error-container-1` | `on-error-1` | Alert banner, toast |
|
|
52
|
+
| **Delete/destructive button** | `error-container-2` | `on-error-2` | Destructive action button |
|
|
53
|
+
| **Error input border** | `border-error-1` | neutral or `error-container-1` | Invalid form field |
|
|
54
|
+
| **High-emphasis error border** | `border-error-2` | `error-container-2` | Destructive button outline |
|
|
55
|
+
| **Warning text on neutral background** | `warning-1` | neutral surface | Caution message |
|
|
56
|
+
| **Warning alert background** | `warning-container-1` | `on-warning-1` | Warning banner, toast |
|
|
57
|
+
| **Warning input border** | `border-warning-1` | neutral or `warning-container-1` | Warning form field |
|
|
58
|
+
| **Success text on neutral background** | `success-1` | neutral surface | Confirmation message |
|
|
59
|
+
| **Success alert background** | `success-container-1` | `on-success-1` | Success banner, toast |
|
|
60
|
+
| **Confirm/save button** | `success-container-2` | `on-success-2` | Confirmation action button |
|
|
61
|
+
| **Success input border** | `border-success-1` | neutral or `success-container-1` | Valid form field |
|
|
62
|
+
| **High-emphasis success border** | `border-success-2` | `success-container-2` | Confirmation button outline |
|
|
63
|
+
| **Info text on neutral background** | `info-1` | neutral surface | Helpful tip text |
|
|
64
|
+
| **Info alert background** | `info-container-1` | `on-info-1` | Info banner, help panel |
|
|
65
|
+
| **Disabled button (subtle)** | `disabled-container-1` | `on-disabled-1` | Inactive neutral button |
|
|
66
|
+
| **Disabled button (strong)** | `disabled-container-2` | `on-disabled-2` | Inactive branded button |
|
|
67
|
+
| **Disabled input border** | `border-disabled-1` | `disabled-container-1` | Disabled form field |
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## General Guidelines (Applies to All Feedback Hooks)
|
|
72
|
+
|
|
73
|
+
### Color Mixing Restrictions
|
|
74
|
+
|
|
75
|
+
#### ❌ Critical Don'ts
|
|
76
|
+
|
|
77
|
+
- **Do not mix feedback types**: Never combine colors from different feedback categories (e.g., `warning-container-1` with `on-error-1`)
|
|
78
|
+
- **Do not mix with system colors**: Avoid using system-level colors or colors from other semantic groups (like surface colors) with feedback colors
|
|
79
|
+
- **Do not use color alone**: Always pair color with text, icons, or ARIA attributes—never rely solely on color to convey meaning
|
|
80
|
+
- **Do not use wrong hook types**: Use border-specific hooks for borders, container hooks for backgrounds, and on-\* hooks for foreground content
|
|
81
|
+
|
|
82
|
+
### Interactive Icon Behavior
|
|
83
|
+
|
|
84
|
+
If a feedback icon is **interactive** (clickable, shows tooltip on hover):
|
|
85
|
+
|
|
86
|
+
- Treat it as a **button icon** component
|
|
87
|
+
- Use button component styling hooks for hover/active states
|
|
88
|
+
- Do NOT use standalone feedback hooks for interactive states
|
|
89
|
+
|
|
90
|
+
**Applies to:** Error, Warning, Success, and Info icons
|
|
91
|
+
|
|
92
|
+
### Best Practices
|
|
93
|
+
|
|
94
|
+
- Always ensure proper contrast ratios are maintained
|
|
95
|
+
- Use appropriate ARIA attributes to communicate state to assistive technologies
|
|
96
|
+
- Match variant numbers for consistency (e.g., `container-1` with `on-[type]-1`)
|
|
97
|
+
- Use `-1` variants for static/non-interactive elements
|
|
98
|
+
- Use `-2` variants for interactive buttons (error/success only) or higher emphasis states
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## Accessibility Principles (Applies to All Feedback Hooks)
|
|
103
|
+
|
|
104
|
+
### Contrast Standards
|
|
105
|
+
|
|
106
|
+
All feedback color hooks are **AA compliant** and maintain a **4.5:1 contrast ratio** using semantic colors with a 50 gradepoint difference between background and foreground colors.
|
|
107
|
+
|
|
108
|
+
### Pairing Recommendations
|
|
109
|
+
|
|
110
|
+
**Default Rule:** Match variant numbers for consistency
|
|
111
|
+
|
|
112
|
+
- Pair `container-1` with `on-[type]-1`
|
|
113
|
+
- Pair `container-2` with `on-[type]-2`
|
|
114
|
+
- Pair `border-[type]-1` with `container-1` or neutral backgrounds
|
|
115
|
+
- Pair `border-[type]-2` with `container-2` or for high-emphasis states
|
|
116
|
+
|
|
117
|
+
**Flexibility:** While matching numbers is recommended for consistency, other pairings are acceptable if:
|
|
118
|
+
|
|
119
|
+
- Content importance requires different emphasis levels
|
|
120
|
+
- Accessibility compliance (≥ 4.5:1 contrast) is maintained
|
|
121
|
+
- The visual hierarchy serves the user experience
|
|
122
|
+
|
|
123
|
+
**For AI agents:** When in doubt, match the variant numbers.
|
|
124
|
+
|
|
125
|
+
### Semantic HTML Requirements
|
|
126
|
+
|
|
127
|
+
**For disabled states**, always include proper attributes:
|
|
128
|
+
|
|
129
|
+
- Use `aria-disabled="true"` or the `disabled` attribute
|
|
130
|
+
- Include descriptive text or tooltips explaining why an element is disabled
|
|
131
|
+
- Ensure keyboard navigation properly skips disabled elements
|
|
132
|
+
|
|
133
|
+
**For error/warning/success states**, provide clear communication:
|
|
134
|
+
|
|
135
|
+
- Use `role="alert"` for dynamic error messages
|
|
136
|
+
- Include `aria-live` regions for screen reader announcements
|
|
137
|
+
- Provide error descriptions that are programmatically associated with form fields
|
|
138
|
+
|
|
139
|
+
### Border Sizing Consistency
|
|
140
|
+
|
|
141
|
+
When using border hooks, maintain consistency with `--slds-g-sizing-border-*` sizing hooks for proper visual weight across the system.
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## Validation Checklist for AI Agents
|
|
146
|
+
|
|
147
|
+
Before implementing feedback color hooks, verify:
|
|
148
|
+
|
|
149
|
+
- [ ] **Correct hook type**: Used border-specific hooks for borders, container hooks for backgrounds, on-\* hooks for foreground
|
|
150
|
+
- [ ] **Appropriate pairing**: Paired container colors with matching on-[type] colors (numbers match or justifiable variance)
|
|
151
|
+
- [ ] **No type mixing**: Did not mix feedback types (e.g., warning + error colors together)
|
|
152
|
+
- [ ] **No system color mixing**: Did not combine with system colors or surface colors from other semantic groups
|
|
153
|
+
- [ ] **ARIA attributes**: Included proper ARIA attributes for disabled states (`aria-disabled`, `disabled`) and alerts (`role="alert"`)
|
|
154
|
+
- [ ] **Not color-only**: Color is not the sole indicator—paired with text, icons, or semantic HTML
|
|
155
|
+
- [ ] **Interactive vs static**: Interactive icons use button component styling; static icons use feedback hooks
|
|
156
|
+
- [ ] **Variant logic**: Used `-1` for static/light emphasis, `-2` for interactive buttons or higher emphasis (where available)
|
|
157
|
+
- [ ] **Contrast verified**: Maintained minimum 4.5:1 contrast ratio for all text and meaningful elements
|
|
158
|
+
- [ ] **Semantic meaning**: Used feedback colors only for their intended purpose (error for errors, warning for warnings, etc.)
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## `--slds-g-color-error-1`
|
|
163
|
+
|
|
164
|
+
### Description
|
|
165
|
+
|
|
166
|
+
Primary error color that indicates errors requiring user attention before progressing.
|
|
167
|
+
|
|
168
|
+
### Usage
|
|
169
|
+
|
|
170
|
+
#### ✅ Do
|
|
171
|
+
|
|
172
|
+
- Works well for indicating errors in forms and validation messages
|
|
173
|
+
- Effective for critical error states requiring immediate attention
|
|
174
|
+
- Can be used for error icons and text on neutral backgrounds
|
|
175
|
+
- Use to signal blocking issues that prevent progression
|
|
176
|
+
- Works well for destructive action text (delete, remove)
|
|
177
|
+
|
|
178
|
+
#### ❌ Don't
|
|
179
|
+
|
|
180
|
+
- Avoid using for large background areas (use error-container instead)
|
|
181
|
+
- Avoid using for non-error contexts or decorative purposes
|
|
182
|
+
|
|
183
|
+
#### Context
|
|
184
|
+
|
|
185
|
+
- Form validation error text
|
|
186
|
+
- Error icons on neutral backgrounds
|
|
187
|
+
- Destructive action button text or icons
|
|
188
|
+
- Error message text on light backgrounds
|
|
189
|
+
- Critical system notification text
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## `--slds-g-color-error-container-*`
|
|
194
|
+
|
|
195
|
+
### Description
|
|
196
|
+
|
|
197
|
+
Error background colors for containers that communicate error states with varying levels of emphasis.
|
|
198
|
+
|
|
199
|
+
### Available Hooks
|
|
200
|
+
|
|
201
|
+
- `--slds-g-color-error-container-1` - Light error background for subtle emphasis
|
|
202
|
+
- `--slds-g-color-error-container-2` - Medium error background for higher emphasis
|
|
203
|
+
|
|
204
|
+
### State Progression Logic
|
|
205
|
+
|
|
206
|
+
Error container variants follow a state progression pattern for interactive destructive elements:
|
|
207
|
+
|
|
208
|
+
- **`error-container-1`**: Light error background for non-interactive error messages, alerts, and banners
|
|
209
|
+
- **`error-container-2`**: Medium error background for destructive button default states, or hover states when starting from container-1
|
|
210
|
+
|
|
211
|
+
**Typical pattern for destructive buttons**: Use `error-container-2` as the default background, with darker borders or overlays for hover/active states (handled by component-level hooks).
|
|
212
|
+
|
|
213
|
+
**Example**: A "Delete" button uses `error-container-2` as its background with `on-error-2` for text color.
|
|
214
|
+
|
|
215
|
+
### Usage
|
|
216
|
+
|
|
217
|
+
#### ✅ Do
|
|
218
|
+
|
|
219
|
+
- Use for error alert backgrounds and error message containers
|
|
220
|
+
- Works well for error banners and toast notifications
|
|
221
|
+
- Effective for destructive button backgrounds (using container-2)
|
|
222
|
+
- Suitable for hover/focus/active states of error-related containers
|
|
223
|
+
|
|
224
|
+
#### ❌ Don't
|
|
225
|
+
|
|
226
|
+
- Avoid using for non-error contexts
|
|
227
|
+
|
|
228
|
+
#### Context
|
|
229
|
+
|
|
230
|
+
- Error alert backgrounds
|
|
231
|
+
- Error message containers
|
|
232
|
+
- Destructive button backgrounds
|
|
233
|
+
- Error banner backgrounds
|
|
234
|
+
- Error toast notifications
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
## `--slds-g-color-border-error-*`
|
|
239
|
+
|
|
240
|
+
### Description
|
|
241
|
+
|
|
242
|
+
Error border colors for visual emphasis of error states with varying levels of emphasis.
|
|
243
|
+
|
|
244
|
+
### Available Hooks
|
|
245
|
+
|
|
246
|
+
- `--slds-g-color-border-error-1` - Primary error border color
|
|
247
|
+
- `--slds-g-color-border-error-2` - Darker error border for increased emphasis
|
|
248
|
+
|
|
249
|
+
### State Progression Logic
|
|
250
|
+
|
|
251
|
+
Border error variants follow standard emphasis patterns:
|
|
252
|
+
|
|
253
|
+
- **`border-error-1`**: Default error border for standard error states
|
|
254
|
+
- **`border-error-2`**: Higher emphasis error border for increased visual weight or interactive hover states
|
|
255
|
+
|
|
256
|
+
**Typical usage**: Use `-1` for default error borders, and `-2` when higher visual emphasis is needed or for interactive state changes.
|
|
257
|
+
|
|
258
|
+
### Usage
|
|
259
|
+
|
|
260
|
+
#### ✅ Do
|
|
261
|
+
|
|
262
|
+
- Works well for error form field borders
|
|
263
|
+
- Effective for error container outlines
|
|
264
|
+
- Can create visual emphasis for error states
|
|
265
|
+
- Suitable for focus indicators on error elements
|
|
266
|
+
- Can use this independently or pair it with an error container color
|
|
267
|
+
- Use border-error-2 for high-emphasis error borders and destructive actions
|
|
268
|
+
|
|
269
|
+
#### ❌ Don't
|
|
270
|
+
|
|
271
|
+
- Avoid using for large background areas (borders should define, not fill)
|
|
272
|
+
- Avoid using non-border error colors on borders to achieve a border with an error color
|
|
273
|
+
|
|
274
|
+
#### Context
|
|
275
|
+
|
|
276
|
+
- Error form field borders
|
|
277
|
+
- Error container outlines
|
|
278
|
+
- Error element indicators
|
|
279
|
+
- Validation error borders
|
|
280
|
+
- Destructive button outlines (border-error-2)
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
## `--slds-g-color-on-error-*`
|
|
285
|
+
|
|
286
|
+
### Description
|
|
287
|
+
|
|
288
|
+
Foreground colors for content placed on error backgrounds, with varying emphasis levels.
|
|
289
|
+
|
|
290
|
+
### Available Hooks
|
|
291
|
+
|
|
292
|
+
- `--slds-g-color-on-error-1` - Foreground for error-container-1 backgrounds
|
|
293
|
+
- `--slds-g-color-on-error-2` - Darker foreground for error-container-2 backgrounds
|
|
294
|
+
|
|
295
|
+
### Usage
|
|
296
|
+
|
|
297
|
+
#### ✅ Do
|
|
298
|
+
|
|
299
|
+
- Works well for text placed on error container backgrounds
|
|
300
|
+
- Effective for icons displayed on error backgrounds
|
|
301
|
+
- Can be used as error text color on neutral surfaces (on-error-1)
|
|
302
|
+
- Best paired with the corresponding error container color
|
|
303
|
+
- Use on-error-2 for destructive button text on error-container-2
|
|
304
|
+
|
|
305
|
+
#### ❌ Don't
|
|
306
|
+
|
|
307
|
+
- Avoid mixing on-error-1 with error-container-2 or vice versa (match variant numbers)
|
|
308
|
+
|
|
309
|
+
#### Context
|
|
310
|
+
|
|
311
|
+
- Text on error container backgrounds
|
|
312
|
+
- Icons on error surfaces
|
|
313
|
+
- Error message text
|
|
314
|
+
- Destructive button text
|
|
315
|
+
|
|
316
|
+
---
|
|
317
|
+
|
|
318
|
+
## `--slds-g-color-warning-1`
|
|
319
|
+
|
|
320
|
+
### Description
|
|
321
|
+
|
|
322
|
+
Primary warning color that indicates potential issues requiring user awareness.
|
|
323
|
+
|
|
324
|
+
> **Why no `-2` variant?** Warning hooks lack a `-2` variant because SLDS2 currently has no interactive warning button components. The `-1` variant serves non-interactive elements like static warning icons, badges, and alert containers. If warning buttons become interactive in future releases, a `-2` variant may be added for hover states.
|
|
325
|
+
|
|
326
|
+
### Usage
|
|
327
|
+
|
|
328
|
+
#### ✅ Do
|
|
329
|
+
|
|
330
|
+
- Works well for indicating warnings and cautions
|
|
331
|
+
- Effective for alerting users to potential issues
|
|
332
|
+
- Can be used for warning icons and text on neutral backgrounds
|
|
333
|
+
- Use to signal non-blocking issues requiring attention
|
|
334
|
+
- Suitable for informing users of consequences before actions
|
|
335
|
+
|
|
336
|
+
#### ❌ Don't
|
|
337
|
+
|
|
338
|
+
- Avoid using for large background areas (use warning-container instead)
|
|
339
|
+
- Avoid using for non-warning contexts or decorative purposes
|
|
340
|
+
|
|
341
|
+
#### Context
|
|
342
|
+
|
|
343
|
+
- Warning message text
|
|
344
|
+
- Caution indicators
|
|
345
|
+
- Warning icons on neutral backgrounds
|
|
346
|
+
- Pre-action warning text
|
|
347
|
+
- Non-critical system notification text
|
|
348
|
+
|
|
349
|
+
---
|
|
350
|
+
|
|
351
|
+
## `--slds-g-color-warning-container-1`
|
|
352
|
+
|
|
353
|
+
### Description
|
|
354
|
+
|
|
355
|
+
Light warning background color for containers that communicate warning states.
|
|
356
|
+
|
|
357
|
+
### Usage
|
|
358
|
+
|
|
359
|
+
#### ✅ Do
|
|
360
|
+
|
|
361
|
+
- Use for warning alert backgrounds
|
|
362
|
+
- Works well for warning banners and toast notifications
|
|
363
|
+
- Effective for caution message containers
|
|
364
|
+
- Pair with `--slds-g-color-on-warning-1` for foreground content
|
|
365
|
+
|
|
366
|
+
#### ❌ Don't
|
|
367
|
+
|
|
368
|
+
- Avoid using for non-warning contexts
|
|
369
|
+
|
|
370
|
+
#### Context
|
|
371
|
+
|
|
372
|
+
- Warning alert backgrounds
|
|
373
|
+
- Warning message containers
|
|
374
|
+
- Caution banner backgrounds
|
|
375
|
+
- Warning toast notifications
|
|
376
|
+
|
|
377
|
+
---
|
|
378
|
+
|
|
379
|
+
## `--slds-g-color-border-warning-1`
|
|
380
|
+
|
|
381
|
+
### Description
|
|
382
|
+
|
|
383
|
+
Warning border color for visual emphasis of warning states.
|
|
384
|
+
|
|
385
|
+
### Usage
|
|
386
|
+
|
|
387
|
+
#### ✅ Do
|
|
388
|
+
|
|
389
|
+
- Works well for warning form field borders
|
|
390
|
+
- Effective for warning container outlines
|
|
391
|
+
- Can create visual emphasis for warning states
|
|
392
|
+
- Suitable for focus indicators on warning elements
|
|
393
|
+
- Can use this independently or pair it with a warning container color
|
|
394
|
+
|
|
395
|
+
#### ❌ Don't
|
|
396
|
+
|
|
397
|
+
- Avoid using for large background areas (borders should define, not fill)
|
|
398
|
+
- Avoid using non-border warning colors on borders to achieve a border with a warning color
|
|
399
|
+
|
|
400
|
+
#### Context
|
|
401
|
+
|
|
402
|
+
- Warning form field borders
|
|
403
|
+
- Warning container outlines
|
|
404
|
+
- Warning element indicators
|
|
405
|
+
- Caution borders
|
|
406
|
+
- **Note**: This hook was added to support form validation patterns. Unlike error/success, there is no `border-warning-2` since warning states don't typically have interactive hover requirements in current SLDS2 components.
|
|
407
|
+
|
|
408
|
+
---
|
|
409
|
+
|
|
410
|
+
## `--slds-g-color-on-warning-1`
|
|
411
|
+
|
|
412
|
+
### Description
|
|
413
|
+
|
|
414
|
+
Foreground color for content placed on warning backgrounds or for warning text on light surfaces.
|
|
415
|
+
|
|
416
|
+
### Usage
|
|
417
|
+
|
|
418
|
+
#### ✅ Do
|
|
419
|
+
|
|
420
|
+
- Works well for text placed on `--slds-g-color-warning-container-1` backgrounds
|
|
421
|
+
- Effective for icons displayed on warning backgrounds
|
|
422
|
+
- Can be used as warning text color on neutral surfaces
|
|
423
|
+
- Best paired with the corresponding warning background color
|
|
424
|
+
|
|
425
|
+
#### ❌ Don't
|
|
426
|
+
|
|
427
|
+
- Avoid mixing with non-matching warning backgrounds
|
|
428
|
+
|
|
429
|
+
#### Context
|
|
430
|
+
|
|
431
|
+
- Text on warning-container-1 backgrounds
|
|
432
|
+
- Icons on warning surfaces
|
|
433
|
+
- Warning message text
|
|
434
|
+
|
|
435
|
+
---
|
|
436
|
+
|
|
437
|
+
## `--slds-g-color-success-1`
|
|
438
|
+
|
|
439
|
+
### Description
|
|
440
|
+
|
|
441
|
+
Primary success color that indicates positive outcomes and successful actions.
|
|
442
|
+
|
|
443
|
+
### Usage
|
|
444
|
+
|
|
445
|
+
#### ✅ Do
|
|
446
|
+
|
|
447
|
+
- Works well for indicating successful operations and confirmations
|
|
448
|
+
- Effective for positive feedback and completion states
|
|
449
|
+
- Can be used for success icons and text on neutral backgrounds
|
|
450
|
+
- Use to signal successful outcomes and achievements
|
|
451
|
+
- Suitable for confirming actions were completed
|
|
452
|
+
|
|
453
|
+
#### ❌ Don't
|
|
454
|
+
|
|
455
|
+
- Avoid using for large background areas (use success-container instead)
|
|
456
|
+
- Avoid using for non-success contexts or decorative purposes
|
|
457
|
+
|
|
458
|
+
#### Context
|
|
459
|
+
|
|
460
|
+
- Success message text
|
|
461
|
+
- Confirmation indicators
|
|
462
|
+
- Success icons on neutral backgrounds
|
|
463
|
+
- Completion state text
|
|
464
|
+
- Positive system notification text
|
|
465
|
+
|
|
466
|
+
---
|
|
467
|
+
|
|
468
|
+
## `--slds-g-color-success-container-*`
|
|
469
|
+
|
|
470
|
+
### Description
|
|
471
|
+
|
|
472
|
+
Success background colors for containers that communicate success states with varying levels of emphasis.
|
|
473
|
+
|
|
474
|
+
### Available Hooks
|
|
475
|
+
|
|
476
|
+
- `--slds-g-color-success-container-1` - Light success background for subtle emphasis
|
|
477
|
+
- `--slds-g-color-success-container-2` - Medium success background for higher emphasis
|
|
478
|
+
|
|
479
|
+
### State Progression Logic
|
|
480
|
+
|
|
481
|
+
Success container variants follow a state progression pattern for interactive confirmation elements:
|
|
482
|
+
|
|
483
|
+
- **`success-container-1`**: Light success background for non-interactive success messages, alerts, and banners
|
|
484
|
+
- **`success-container-2`**: Medium success background for confirmation button default states, or hover states when starting from container-1
|
|
485
|
+
|
|
486
|
+
**Typical pattern for confirmation buttons**: Use `success-container-2` as the default background, with darker borders or overlays for hover/active states (handled by component-level hooks).
|
|
487
|
+
|
|
488
|
+
**Example**: A "Confirm" or "Save" button uses `success-container-2` as its background with `on-success-2` for text color.
|
|
489
|
+
|
|
490
|
+
### Usage
|
|
491
|
+
|
|
492
|
+
#### ✅ Do
|
|
493
|
+
|
|
494
|
+
- Use for success alert backgrounds and success message containers
|
|
495
|
+
- Works well for success banners and toast notifications
|
|
496
|
+
- Effective for confirmation button backgrounds (using container-2)
|
|
497
|
+
- Suitable for hover/focus/active states of success-related containers
|
|
498
|
+
|
|
499
|
+
#### ❌ Don't
|
|
500
|
+
|
|
501
|
+
- Avoid using for non-success contexts
|
|
502
|
+
|
|
503
|
+
#### Context
|
|
504
|
+
|
|
505
|
+
- Success alert backgrounds
|
|
506
|
+
- Success message containers
|
|
507
|
+
- Confirmation button backgrounds
|
|
508
|
+
- Success banner backgrounds
|
|
509
|
+
- Success toast notifications
|
|
510
|
+
|
|
511
|
+
---
|
|
512
|
+
|
|
513
|
+
## `--slds-g-color-border-success-*`
|
|
514
|
+
|
|
515
|
+
### Description
|
|
516
|
+
|
|
517
|
+
Success border colors for visual emphasis of success states with varying levels of emphasis.
|
|
518
|
+
|
|
519
|
+
### Available Hooks
|
|
520
|
+
|
|
521
|
+
- `--slds-g-color-border-success-1` - Primary success border color
|
|
522
|
+
- `--slds-g-color-border-success-2` - Darker success border for increased emphasis
|
|
523
|
+
|
|
524
|
+
### State Progression Logic
|
|
525
|
+
|
|
526
|
+
Border success variants follow standard emphasis patterns:
|
|
527
|
+
|
|
528
|
+
- **`border-success-1`**: Default success border for standard success states
|
|
529
|
+
- **`border-success-2`**: Higher emphasis success border for increased visual weight or interactive hover states
|
|
530
|
+
|
|
531
|
+
**Typical usage**: Use `-1` for default success borders, and `-2` when higher visual emphasis is needed or for interactive state changes.
|
|
532
|
+
|
|
533
|
+
### Usage
|
|
534
|
+
|
|
535
|
+
#### ✅ Do
|
|
536
|
+
|
|
537
|
+
- Works well for success form field borders
|
|
538
|
+
- Effective for success container outlines
|
|
539
|
+
- Can create visual emphasis for success states
|
|
540
|
+
- Suitable for focus indicators on success elements
|
|
541
|
+
- Can use this independently or pair it with a success container color
|
|
542
|
+
- Use border-success-2 for high-emphasis success borders
|
|
543
|
+
|
|
544
|
+
#### ❌ Don't
|
|
545
|
+
|
|
546
|
+
- Avoid using for large background areas (borders should define, not fill)
|
|
547
|
+
- Avoid using non-border success colors on borders to achieve a border with a success color
|
|
548
|
+
|
|
549
|
+
#### Context
|
|
550
|
+
|
|
551
|
+
- Success form field borders
|
|
552
|
+
- Success container outlines
|
|
553
|
+
- Success element indicators
|
|
554
|
+
- Confirmation borders
|
|
555
|
+
- Emphasized confirmation outlines (border-success-2)
|
|
556
|
+
|
|
557
|
+
---
|
|
558
|
+
|
|
559
|
+
## `--slds-g-color-on-success-*`
|
|
560
|
+
|
|
561
|
+
### Description
|
|
562
|
+
|
|
563
|
+
Foreground colors for content placed on success backgrounds, with varying emphasis levels.
|
|
564
|
+
|
|
565
|
+
### Available Hooks
|
|
566
|
+
|
|
567
|
+
- `--slds-g-color-on-success-1` - Foreground for success-container-1 backgrounds
|
|
568
|
+
- `--slds-g-color-on-success-2` - Darker foreground for success-container-2 backgrounds
|
|
569
|
+
|
|
570
|
+
### Usage
|
|
571
|
+
|
|
572
|
+
#### ✅ Do
|
|
573
|
+
|
|
574
|
+
- Works well for text placed on success container backgrounds
|
|
575
|
+
- Effective for icons displayed on success backgrounds
|
|
576
|
+
- Can be used as success text color on neutral surfaces (on-success-1)
|
|
577
|
+
- Best paired with the corresponding success container color
|
|
578
|
+
- Use on-success-2 for confirmation button text on success-container-2
|
|
579
|
+
|
|
580
|
+
#### ❌ Don't
|
|
581
|
+
|
|
582
|
+
- Avoid mixing on-success-1 with success-container-2 or vice versa (match variant numbers)
|
|
583
|
+
|
|
584
|
+
#### Context
|
|
585
|
+
|
|
586
|
+
- Text on success container backgrounds
|
|
587
|
+
- Icons on success surfaces
|
|
588
|
+
- Success message text
|
|
589
|
+
- Confirmation button text
|
|
590
|
+
|
|
591
|
+
---
|
|
592
|
+
|
|
593
|
+
## `--slds-g-color-info-1`
|
|
594
|
+
|
|
595
|
+
### Description
|
|
596
|
+
|
|
597
|
+
Primary info color that conveys non-critical information to users.
|
|
598
|
+
|
|
599
|
+
> **Why no `-2` variant?** Info hooks lack a `-2` variant because SLDS2 currently has no interactive info button components. The `-1` variant serves non-interactive elements like static info badges, icons, and alert containers. If info buttons become interactive in future releases, a `-2` variant may be added for hover states.
|
|
600
|
+
|
|
601
|
+
### Usage
|
|
602
|
+
|
|
603
|
+
#### ✅ Do
|
|
604
|
+
|
|
605
|
+
- Works well for indicating informational messages
|
|
606
|
+
- Effective for helpful tips and guidance
|
|
607
|
+
- Can be used for info icons and text on neutral backgrounds
|
|
608
|
+
- Use to signal non-critical information
|
|
609
|
+
- Suitable for educational or contextual content
|
|
610
|
+
|
|
611
|
+
#### ❌ Don't
|
|
612
|
+
|
|
613
|
+
- Avoid using for large background areas (use info-container instead)
|
|
614
|
+
- Avoid using for non-informational contexts or decorative purposes
|
|
615
|
+
|
|
616
|
+
#### Context
|
|
617
|
+
|
|
618
|
+
- Informational message text
|
|
619
|
+
- Help text and tooltips
|
|
620
|
+
- Info icons on neutral backgrounds
|
|
621
|
+
- Contextual guidance text
|
|
622
|
+
- Educational notification text
|
|
623
|
+
|
|
624
|
+
---
|
|
625
|
+
|
|
626
|
+
## `--slds-g-color-info-container-1`
|
|
627
|
+
|
|
628
|
+
### Description
|
|
629
|
+
|
|
630
|
+
Light info background color for containers that communicate informational states.
|
|
631
|
+
|
|
632
|
+
### Usage
|
|
633
|
+
|
|
634
|
+
#### ✅ Do
|
|
635
|
+
|
|
636
|
+
- Use for info alert backgrounds
|
|
637
|
+
- Works well for info banners and toast notifications
|
|
638
|
+
- Effective for help panel backgrounds
|
|
639
|
+
- Pair with `--slds-g-color-on-info-1` for foreground content
|
|
640
|
+
|
|
641
|
+
#### ❌ Don't
|
|
642
|
+
|
|
643
|
+
- Avoid using for non-informational contexts
|
|
644
|
+
|
|
645
|
+
#### Context
|
|
646
|
+
|
|
647
|
+
- Info alert backgrounds
|
|
648
|
+
- Info message containers
|
|
649
|
+
- Help panel backgrounds
|
|
650
|
+
- Info banner backgrounds
|
|
651
|
+
- Info toast notifications
|
|
652
|
+
|
|
653
|
+
---
|
|
654
|
+
|
|
655
|
+
## `--slds-g-color-on-info-1`
|
|
656
|
+
|
|
657
|
+
### Description
|
|
658
|
+
|
|
659
|
+
Foreground color for content placed on info backgrounds or for info text on light surfaces.
|
|
660
|
+
|
|
661
|
+
### Usage
|
|
662
|
+
|
|
663
|
+
#### ✅ Do
|
|
664
|
+
|
|
665
|
+
- Works well for text placed on `--slds-g-color-info-container-1` backgrounds
|
|
666
|
+
- Effective for icons displayed on info backgrounds
|
|
667
|
+
- Can be used as info text color on neutral surfaces
|
|
668
|
+
- Best paired with the corresponding info background color
|
|
669
|
+
|
|
670
|
+
#### ❌ Don't
|
|
671
|
+
|
|
672
|
+
- Avoid mixing with non-matching info backgrounds
|
|
673
|
+
|
|
674
|
+
#### Context
|
|
675
|
+
|
|
676
|
+
- Text on info-container-1 backgrounds
|
|
677
|
+
- Icons on info surfaces
|
|
678
|
+
- Info message text
|
|
679
|
+
- Help text on info backgrounds
|
|
680
|
+
|
|
681
|
+
---
|
|
682
|
+
|
|
683
|
+
## `--slds-g-color-disabled-1`
|
|
684
|
+
|
|
685
|
+
### Description
|
|
686
|
+
|
|
687
|
+
Primary disabled color that indicates components are unavailable for interaction.
|
|
688
|
+
|
|
689
|
+
### Usage
|
|
690
|
+
|
|
691
|
+
#### ✅ Do
|
|
692
|
+
|
|
693
|
+
- Works well for indicating disabled or inactive elements
|
|
694
|
+
- Effective for non-interactive states
|
|
695
|
+
- Can be used for disabled borders and backgrounds
|
|
696
|
+
- Use to signal unavailable functionality
|
|
697
|
+
- Suitable for inactive form fields and buttons
|
|
698
|
+
|
|
699
|
+
#### ❌ Don't
|
|
700
|
+
|
|
701
|
+
- Avoid using for active or interactive elements
|
|
702
|
+
- Avoid using for decorative purposes
|
|
703
|
+
|
|
704
|
+
#### Context
|
|
705
|
+
|
|
706
|
+
- Disabled form field borders
|
|
707
|
+
- Inactive button backgrounds
|
|
708
|
+
- Unavailable menu items
|
|
709
|
+
- Non-interactive element styling
|
|
710
|
+
- Grayed-out content
|
|
711
|
+
|
|
712
|
+
---
|
|
713
|
+
|
|
714
|
+
## `--slds-g-color-disabled-container-*`
|
|
715
|
+
|
|
716
|
+
### Description
|
|
717
|
+
|
|
718
|
+
Disabled container background colors for unavailable states with varying levels of emphasis.
|
|
719
|
+
|
|
720
|
+
### Available Hooks
|
|
721
|
+
|
|
722
|
+
- `--slds-g-color-disabled-container-1` - Light disabled background
|
|
723
|
+
- `--slds-g-color-disabled-container-2` - Medium emphasis disabled background
|
|
724
|
+
|
|
725
|
+
### Understanding Disabled Container Variants
|
|
726
|
+
|
|
727
|
+
Disabled container variants provide different visual weights for unavailable states:
|
|
728
|
+
|
|
729
|
+
- **`disabled-container-1`**: Light disabled background for subtle de-emphasis
|
|
730
|
+
- **`disabled-container-2`**: Medium disabled background for stronger visual de-emphasis
|
|
731
|
+
|
|
732
|
+
**These are NOT state progressions**: Disabled elements have no interactive states. The variant numbers represent different levels of visual de-emphasis based on component needs, not hover/active states.
|
|
733
|
+
|
|
734
|
+
**Typical usage**: Choose based on desired visual weight—`disabled-container-1` for subtle de-emphasis (common in form fields and neutral buttons), `disabled-container-2` for stronger de-emphasis (common in filled branded buttons).
|
|
735
|
+
|
|
736
|
+
### Usage
|
|
737
|
+
|
|
738
|
+
#### ✅ Do
|
|
739
|
+
|
|
740
|
+
- Use for disabled button backgrounds
|
|
741
|
+
- Works well for inactive form field backgrounds
|
|
742
|
+
- Effective for unavailable container states
|
|
743
|
+
- Suitable for grayed-out panel backgrounds
|
|
744
|
+
|
|
745
|
+
#### ❌ Don't
|
|
746
|
+
|
|
747
|
+
- Avoid using for active or interactive containers
|
|
748
|
+
- Avoid for elements that should remain visually prominent
|
|
749
|
+
|
|
750
|
+
#### Context
|
|
751
|
+
|
|
752
|
+
- Disabled button backgrounds
|
|
753
|
+
- Inactive form field backgrounds
|
|
754
|
+
- Unavailable container backgrounds
|
|
755
|
+
- Grayed-out panels
|
|
756
|
+
- Non-interactive element backgrounds
|
|
757
|
+
|
|
758
|
+
---
|
|
759
|
+
|
|
760
|
+
## `--slds-g-color-border-disabled-1`
|
|
761
|
+
|
|
762
|
+
### Description
|
|
763
|
+
|
|
764
|
+
Disabled border color for visual emphasis of unavailable states.
|
|
765
|
+
|
|
766
|
+
### Usage
|
|
767
|
+
|
|
768
|
+
#### ✅ Do
|
|
769
|
+
|
|
770
|
+
- Works well for disabled form field borders
|
|
771
|
+
- Effective for inactive container outlines
|
|
772
|
+
- Can create visual emphasis for disabled states
|
|
773
|
+
- Can use this independently or pair it with a disabled container color
|
|
774
|
+
|
|
775
|
+
#### ❌ Don't
|
|
776
|
+
|
|
777
|
+
- Avoid using for active or interactive elements
|
|
778
|
+
- Avoid using non-border disabled colors on borders
|
|
779
|
+
|
|
780
|
+
#### Context
|
|
781
|
+
|
|
782
|
+
- Disabled form field borders
|
|
783
|
+
- Inactive container outlines
|
|
784
|
+
- Unavailable element borders
|
|
785
|
+
- Grayed-out element borders
|
|
786
|
+
|
|
787
|
+
---
|
|
788
|
+
|
|
789
|
+
## `--slds-g-color-on-disabled-*`
|
|
790
|
+
|
|
791
|
+
### Description
|
|
792
|
+
|
|
793
|
+
Foreground colors for content placed on disabled backgrounds, with varying emphasis levels.
|
|
794
|
+
|
|
795
|
+
### Available Hooks
|
|
796
|
+
|
|
797
|
+
- `--slds-g-color-on-disabled-1` - Foreground for disabled-container-1 backgrounds
|
|
798
|
+
- `--slds-g-color-on-disabled-2` - Darker foreground for disabled content requiring more emphasis
|
|
799
|
+
|
|
800
|
+
### Usage
|
|
801
|
+
|
|
802
|
+
#### ✅ Do
|
|
803
|
+
|
|
804
|
+
- Works well for text placed on disabled container backgrounds
|
|
805
|
+
- Effective for icons displayed on disabled backgrounds
|
|
806
|
+
- Best paired with the corresponding disabled container color
|
|
807
|
+
- Use on-disabled-2 for disabled content requiring better readability
|
|
808
|
+
|
|
809
|
+
#### ❌ Don't
|
|
810
|
+
|
|
811
|
+
- Avoid using on active or interactive backgrounds
|
|
812
|
+
- Avoid using for elements that should appear fully interactive
|
|
813
|
+
|
|
814
|
+
#### Context
|
|
815
|
+
|
|
816
|
+
- Text on disabled container backgrounds
|
|
817
|
+
- Icons on disabled surfaces
|
|
818
|
+
- Disabled button text
|
|
819
|
+
- Inactive form field text
|