sf-lwc-design

Create SLDS 2 compliant LWC components using --slds-g-* hooks.

15|Updated Jan 27, 2026
One-click install
npx skills add https://github.com/sfdc-brendan/Demo-Lab --skill sf-lwc-design
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sf-lwc-design
Source: https://github.com/sfdc-brendan/Demo-Lab/tree/main/skills/sf-lwc-design
Command: npx skills add https://github.com/sfdc-brendan/Demo-Lab --skill sf-lwc-design

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

SLDS 2 design foundation provides a consistent baseline for building SLDS 2 compliant Lightning Web Components. It ensures the use of global styling hooks (--slds-g-*) and a theme-safe approach across light/dark modes, enabling scalable, maintainable design systems.

Core Features & Use Cases

  • Enforces SLDS 2 design tokens across components using --slds-g-* hooks.
  • Prefers lightning-* base components to ensure accessibility and consistency.
  • Provides migration guidance from SLDS 1 and a structured component architecture for LWC development.
  • Use Case: when building new LWCs or migrating existing ones to SLDS 2 to maintain visual consistency and theming across apps.

Quick Start

Generate a new LWC scaffold that uses SLDS 2 tokens and applies the global --slds-g-* hooks.

Frequently Asked Questions about sf-lwc-design

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

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

Migrating LWC components from SLDS 1 to SLDS 2 involves applying the provided migration path to replace legacy styling with global design hooks (--slds-g-*). This transition ensures your components adopt a theme-safe approach for light and dark modes.

What are SLDS 2 global styling hooks and when do I need them?

SLDS 2 global styling hooks (--slds-g-*) are CSS custom properties that enable theme-safe visual consistency across light and dark modes. You need them when building new LWCs or migrating existing ones to maintain a scalable, maintainable design system.

How do I scaffold a new Lightning Web Component with SLDS 2 design tokens?

Scaffolding a new LWC with SLDS 2 design tokens involves using the quick start generation to apply global --slds-g-* hooks. This creates a structured component architecture that prefers lightning-* base components to ensure accessibility and visual consistency.

Do I need to use lightning-* base components for SLDS 2 compliance?

Using lightning-* base components is strongly preferred for SLDS 2 compliance to ensure accessibility and visual consistency across your applications. This approach works synergistically with applying global --slds-g-* styling hooks for theme-safe development.

What is the best way to ensure theme-safe styling in LWC development?

The best way to ensure theme-safe styling in LWC development is enforcing SLDS 2 design tokens using global --slds-g-* hooks. This method provides a consistent baseline for light and dark modes while maintaining a scalable, maintainable design system foundation.

Can I use SLDS 2 CSS tokens without migrating my entire LWC architecture?

You can apply SLDS 2 CSS tokens to specific components without immediately overhauling your entire LWC architecture. The structured migration path allows incremental adoption of --slds-g-* hooks while still preferring lightning-* base components.