When to use this skill
Use this skill whenever the user wants to:
- Install and configure Dart Sass
- Compile Sass/SCSS files to CSS
- Use Sass syntax features (variables, nesting, mixins, functions, etc.)
- Work with Sass modules and imports
- Integrate Sass into build tools or workflows
- Use Sass CLI commands
- Configure Sass compilation options
- Use Sass in JavaScript or Dart projects
- Optimize Sass compilation performance
- Handle Sass source maps
How to use this skill
To use Dart Sass:
Install Dart Sass:
- Load
examples/getting-started/installation.md for installation instructions
- Load
examples/getting-started/basic-usage.md for basic usage examples
- Load
examples/getting-started/compiling-modes.md for different compilation modes
Learn Sass syntax:
- Load
examples/syntax/variables.md for variable usage
- Load
examples/syntax/nesting.md for nesting syntax
- Load
examples/syntax/mixins.md for mixins
- Load
examples/syntax/functions.md for functions
- Load
examples/syntax/operators.md for operators
- Load
examples/syntax/at-rules.md for at-rules
Use advanced features:
- Load
examples/features/modules.md for module system
- Load
examples/features/imports.md for imports
- Load
examples/features/control-flow.md for control flow
- Load
examples/features/built-in-modules.md for built-in modules
- Load
examples/features/source-maps.md for source maps
- Load
examples/features/custom-functions.md for custom functions
Reference the API documentation when needed:
api/js-api.md - JavaScript API reference
api/dart-api.md - Dart API reference
api/cli-api.md - CLI command reference
Use templates for quick start:
templates/basic-project.md - Basic Sass project template
templates/modular-project.md - Modular Sass project template
templates/build-integration.md - Build tool integration template
Doc mapping (one-to-one with official documentation)
Examples and Templates
This skill includes detailed examples organized to match the official documentation structure. All examples are in the examples/ directory (see mapping above).
To use examples:
- Identify the topic from the user's request
- Load the appropriate example file from the mapping above
- Follow the instructions, syntax, and best practices in that file
- Adapt the code examples to your specific use case
To use templates:
- Reference templates in
templates/ directory for common scaffolding
- Adapt templates to your specific needs and coding style
API Reference
- JavaScript API:
api/js-api.md - JavaScript API for compiling Sass (compile, compileString, etc.)
- Dart API:
api/dart-api.md - Dart API for compiling Sass
- CLI API:
api/cli-api.md - Command-line interface options and usage
Best Practices
- Use @use instead of @import: The @import rule is deprecated, use @use and @forward instead
- Organize with modules: Use the module system to organize and share code
- Optimize compilation: Use appropriate output style (compressed for production)
- Source maps: Enable source maps for development, disable for production
- Watch mode: Use --watch for development to automatically recompile on changes
- Load paths: Use --load-path to simplify import paths
- Performance: Use Dart Sass for best performance (faster than Ruby Sass)
- Version control: Don't commit compiled CSS files, only commit Sass source files
Resources
Keywords
dart-sass, sass, scss, css preprocessor, sass compiler, sass syntax, sass modules, sass mixins, sass functions, sass variables, sass nesting, @use, @forward, @import, @include, @mixin, @function, sass:math, sass:color, sass:string, source maps, sass cli, sass api, 样式预处理器, Sass 编译器, Sass 语法, Sass 模块, Sass 混合, Sass 函数
能力边界
✅ 适用场景
- 当你需要使用此技能对应的技术栈时
- 当项目需要遵循最佳实践时
- 当需要快速上手或深入理解核心概念时
⚠️ 需要注意
- 复杂业务逻辑需要结合具体场景调整
- 性能优化需要根据实际数据量评估
❌ 不适用场景
常见陷阱 (Gotchas)
- 版本兼容性:注意框架版本与依赖库的兼容性,不同版本 API 可能有差异
- 配置文件格式:配置文件格式错误是最常见的问题,建议使用编辑器的语法检查
- 环境变量:确保所有必要的环境变量已正确设置,敏感信息不要硬编码
- 依赖冲突:多版本共存时注意依赖冲突,使用 lock 文件锁定版本
- 性能陷阱:大数据量场景下注意性能优化,避免 N+1 查询等常见问题
使用流程
Step 1: 环境准备
确保开发环境已安装必要的依赖和工具。
Step 2: 配置初始化
根据项目需求进行基础配置。
Step 3: 核心功能使用
按照示例代码实现核心功能。
Step 4: 测试验证
运行测试确保功能正常。
Step 5: 部署上线
完成开发后进行部署和监控。
1---2name: dart-sass3description: Provides comprehensive guidance for Dart Sass including Sass syntax, compilation, mixins, functions, and best practices. Use when the user asks about Dart Sass, needs to compile Sass to CSS, use Sass features, or work with Sass in projects.4license: Complete terms in LICENSE.txt5---67## When to use this skill89Use this skill whenever the user wants to:10- Install and configure Dart Sass11- Compile Sass/SCSS files to CSS12- Use Sass syntax features (variables, nesting, mixins, functions, etc.)13- Work with Sass modules and imports14- Integrate Sass into build tools or workflows15- Use Sass CLI commands16- Configure Sass compilation options17- Use Sass in JavaScript or Dart projects18- Optimize Sass compilation performance19- Handle Sass source maps2021## How to use this skill2223To use Dart Sass:24251. **Install Dart Sass**:26 - Load `examples/getting-started/installation.md` for installation instructions27 - Load `examples/getting-started/basic-usage.md` for basic usage examples28 - Load `examples/getting-started/compiling-modes.md` for different compilation modes29302. **Learn Sass syntax**:31 - Load `examples/syntax/variables.md` for variable usage32 - Load `examples/syntax/nesting.md` for nesting syntax33 - Load `examples/syntax/mixins.md` for mixins34 - Load `examples/syntax/functions.md` for functions35 - Load `examples/syntax/operators.md` for operators36 - Load `examples/syntax/at-rules.md` for at-rules37383. **Use advanced features**:39 - Load `examples/features/modules.md` for module system40 - Load `examples/features/imports.md` for imports41 - Load `examples/features/control-flow.md` for control flow42 - Load `examples/features/built-in-modules.md` for built-in modules43 - Load `examples/features/source-maps.md` for source maps44 - Load `examples/features/custom-functions.md` for custom functions45464. **Reference the API documentation** when needed:47 - `api/js-api.md` - JavaScript API reference48 - `api/dart-api.md` - Dart API reference49 - `api/cli-api.md` - CLI command reference50515. **Use templates** for quick start:52 - `templates/basic-project.md` - Basic Sass project template53 - `templates/modular-project.md` - Modular Sass project template54 - `templates/build-integration.md` - Build tool integration template555657### Doc mapping (one-to-one with official documentation)5859- `examples/` → https://sass-lang.com/documentation/6061## Examples and Templates6263This skill includes detailed examples organized to match the official documentation structure. All examples are in the `examples/` directory (see mapping above).6465**To use examples:**66- Identify the topic from the user's request67- Load the appropriate example file from the mapping above68- Follow the instructions, syntax, and best practices in that file69- Adapt the code examples to your specific use case7071**To use templates:**72- Reference templates in `templates/` directory for common scaffolding73- Adapt templates to your specific needs and coding style7475## API Reference7677- **JavaScript API**: `api/js-api.md` - JavaScript API for compiling Sass (compile, compileString, etc.)78- **Dart API**: `api/dart-api.md` - Dart API for compiling Sass79- **CLI API**: `api/cli-api.md` - Command-line interface options and usage8081## Best Practices82831. **Use @use instead of @import**: The @import rule is deprecated, use @use and @forward instead842. **Organize with modules**: Use the module system to organize and share code853. **Optimize compilation**: Use appropriate output style (compressed for production)864. **Source maps**: Enable source maps for development, disable for production875. **Watch mode**: Use --watch for development to automatically recompile on changes886. **Load paths**: Use --load-path to simplify import paths897. **Performance**: Use Dart Sass for best performance (faster than Ruby Sass)908. **Version control**: Don't commit compiled CSS files, only commit Sass source files9192## Resources9394- **Official Website**: https://sass-lang.com/dart-sass/95- **Installation Guide**: https://sass-lang.com/install/96- **Documentation**: https://sass-lang.com/documentation/97- **GitHub Repository**: https://github.com/sass/dart-sass98- **npm Package**: https://www.npmjs.com/package/sass99- **pub.dev Package**: https://pub.dev/packages/sass100101## Keywords102103dart-sass, sass, scss, css preprocessor, sass compiler, sass syntax, sass modules, sass mixins, sass functions, sass variables, sass nesting, @use, @forward, @import, @include, @mixin, @function, sass:math, sass:color, sass:string, source maps, sass cli, sass api, 样式预处理器, Sass 编译器, Sass 语法, Sass 模块, Sass 混合, Sass 函数104105## 能力边界106107### ✅ 适用场景108- 当你需要使用此技能对应的技术栈时109- 当项目需要遵循最佳实践时110- 当需要快速上手或深入理解核心概念时111112### ⚠️ 需要注意113- 复杂业务逻辑需要结合具体场景调整114- 性能优化需要根据实际数据量评估115116### ❌ 不适用场景117- 不相关的技术栈或框架118- 需要完全自定义的特殊场景119120## 常见陷阱 (Gotchas)1211221. **版本兼容性**:注意框架版本与依赖库的兼容性,不同版本 API 可能有差异1232. **配置文件格式**:配置文件格式错误是最常见的问题,建议使用编辑器的语法检查1243. **环境变量**:确保所有必要的环境变量已正确设置,敏感信息不要硬编码1254. **依赖冲突**:多版本共存时注意依赖冲突,使用 lock 文件锁定版本1265. **性能陷阱**:大数据量场景下注意性能优化,避免 N+1 查询等常见问题127128## 使用流程129130### Step 1: 环境准备131确保开发环境已安装必要的依赖和工具。132133### Step 2: 配置初始化134根据项目需求进行基础配置。135136### Step 3: 核心功能使用137按照示例代码实现核心功能。138139### Step 4: 测试验证140运行测试确保功能正常。141142### Step 5: 部署上线143完成开发后进行部署和监控。