uplifting-components-to-slds2

Migrate LWC styling from SLDS 1 to SLDS 2 with hook-based replacements.

803|289|Updated Nov 7, 2025
One-click install
npx skills add https://github.com/forcedotcom/sf-skills --skill uplifting-components-to-slds2-forcedotcom
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: uplifting-components-to-slds2
Source: https://github.com/forcedotcom/sf-skills/tree/main/skills/uplifting-components-to-slds2
Command: npx skills add https://github.com/forcedotcom/sf-skills --skill uplifting-components-to-slds2-forcedotcom

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you migrate Lightning Web Component styling from SLDS 1 to SLDS 2 by systematically replacing deprecated tokens, hardcoded styling values, and unsupported SLDS class overrides using the SLDS linter.

Core Features & Use Cases

  • Run SLDS linter with auto-fix to address straightforward violations across CSS and component markup.
  • Fix remaining violations by type, including hardcoded values, deprecated LWC tokens, LWC/SLDS hook replacements, and .slds-* class override rules that require matching HTML markup updates.
  • Choose correct SLDS 2 styling hooks for all styling hook families (color, spacing, sizing, typography, borders/radius, and shadows), preserving original values via required fallbacks for zero-regression behavior.

Quick Start

Use the uplifting-components-to-slds2 skill to lint and migrate your LWC CSS and markup from SLDS 1 to SLDS 2 by running the SLDS linter with auto-fix, then applying the remaining manual fixes based on the linter’s violation types and reference guides.

Frequently Asked Questions about uplifting-components-to-slds2

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate LWC styling from SLDS 1 to SLDS 2 styling hooks?

To migrate LWC styling to SLDS 2, run the SLDS linter with auto-fix to resolve straightforward violations, then manually replace deprecated tokens and hardcoded values with SLDS 2 styling hooks. This process ensures your components satisfy SLDS linter rules across all styling categories.

What is the best way to fix no-hardcoded-values-slds2 linter violations?

Fixing no-hardcoded-values-slds2 violations involves replacing hardcoded CSS values with SLDS 2 styling hooks. You must include required fallback values during replacement to preserve original rendering and ensure zero-regression behavior while satisfying SLDS linter rules.

How do I resolve slds/no-slds-class-overrides markup violations in Lightning components?

Resolving slds/no-slds-class-overrides violations requires updating the matching HTML markup in your LWC or Aura components. You replace unsupported SLDS class overrides with appropriate SLDS 2 styling hooks to bring both the CSS and component markup into compliance.

Does migrating to SLDS 2 styling hooks support Aura components or only LWC?

Migrating to SLDS 2 styling hooks applies when updating both LWC and Aura component styles. The migration process converts deprecated tokens, hardcoded styling values, and unsupported class overrides across color, spacing, sizing, typography, border/radius, and shadow categories for both component types.

Why do my SLDS 2 styling hook replacements need fallback values?

SLDS 2 styling hook replacements require fallback values to preserve original rendering and achieve zero-regression behavior. These fallbacks ensure the component maintains its exact visual output while transitioning away from deprecated SLDS 1 tokens and hardcoded styling values.

Can I auto-fix all deprecated LWC token replacements during an SLDS 2 migration?

You can auto-fix straightforward deprecated LWC token replacements by running the SLDS linter, but remaining violations require manual fixes. You must manually choose correct SLDS 2 styling hooks for each family, including color, spacing, sizing, typography, borders/radius, and shadows, based on linter violation types.