Angular Best Practices Material

alfredoperez/angular-best-practices/skills/angular-best-practices-material

作者 alfredopereza499a4786182097a500dd2fb6ddc2489caee3854MIT37 個星標收錄於 2026年10月9日更新於 2026年10月9日儲存庫6 個月前更新

Angular Material and CDK best practices. Covers selective imports, M3 theming, CDK utilities, and component test harnesses. Activates when working with @angular/material and @angular/cdk. Do not use for PrimeNG, Spartan UI, or other component libraries. Install alongside angular-best-practices for full coverage.

已封存僅含說明Software Development
AI 產生的概覽

Angular Material 與 CDK 最佳實務規則,涵蓋選擇性匯入、M3 主題、CDK 工具與元件測試 harness。

功能
提供在專案中使用 Angular Material 與 Angular CDK 的指引規則。內容涵蓋:以獨立匯入選擇性載入元件以利 tree-shaking、使用 CSS 自訂屬性設定 M3 主題、優先採用 CDK 提供的覆蓋層、拖放、虛擬捲動與無障礙工具,以及使用元件測試 harness。這是純指示型的附加技能,需與核心 Angular 最佳實務技能一併安裝。
適用情境
適用於匯入或設定 @angular/material 元件、以設計權杖建立 M3 主題、套用 CDK 工具,或為 Material 元件撰寫測試的情境。不適用於 PrimeNG、Spartan UI 或其他元件庫。
執行需求
不隨附指令碼或套件,僅為指示內容。假定專案為使用 @angular/material 與 @angular/cdk 的 Angular 專案,並設計為與核心 angular-best-practices 技能一同安裝。

Angular Material Best Practices

Angular Material and CDK rules for component usage, theming, and testing. Use with the core angular-best-practices skill for comprehensive Angular coverage.

Links

When to Apply

  • Importing and configuring Material components
  • Setting up M3 theming with design tokens
  • Using CDK utilities for overlays, drag-and-drop, or virtual scrolling
  • Writing tests for Material components

Rules

RuleImpactDescription
Import Material Modules SelectivelyMEDIUMTree-shake unused components with standalone imports
Use Angular Material Theming SystemMEDIUMM3 theme API with CSS custom properties
Use CDK Utilities Over Custom ImplementationsMEDIUMBattle-tested overlays, virtual scroll, and a11y primitives
Use Test Harnesses for Material ComponentsHIGHStable tests that survive internal DOM changes

Install

Install from skills.sh/alfredoperez/angular-best-practices:

來源與署名

來源:alfredoperez/angular-best-practices位於skills/angular-best-practices-material提交a499a47

授權條款: MIT

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架