在AngularDart 5和Dart 2中使用SCSS样式文件 [英] Use SCSS style files within AngularDart 5 and Dart 2

查看:50
本文介绍了在AngularDart 5和Dart 2中使用SCSS样式文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Dart 2 AngularDart 5 .

I’m working with Dart 2 and AngularDart 5.

⚠我在网上搜索了自己的问题,但没有找到满意的答案.

⚠ I searched online about my question, but I didn’t find a satisfactory answer.

❔有人可以解释 all 我在AngularDart应用程序中包含和使用 SCSS 样式文件的步骤吗?

❔ Can somebody explain all the steps I need to include and to work with SCSS style files within my AngularDart application?

我从快速启动应用程序开始,您可以找到

I started with quickstart application that you can find here.

谢谢!

推荐答案

  1. sass_builder: ^2.0.0将dev依赖项添加到pubspec.yaml中.
  2. 运行pub get以下载新的依赖项.
  3. 创建一个萨斯文件,例如:lib/app_component.scss并为其添加一些样式.
  4. 已编译 的CSS样式表添加到lib/app_component.dart中的@Component注释中: styleUrls: const ['app_component.css'],
  1. Add a dev dependency to your pubspec.yaml for sass_builder: ^2.0.0.
  2. Run pub get to download the new dependencies.
  3. Create a sass file ex: lib/app_component.scss and add some styles to it.
  4. Add a the compiled css stylesheet to your the @Component annotation in lib/app_component.dart: styleUrls: const ['app_component.css'],

css文件将在构建过程中由sass_builder生成.

The css file will be generated by sass_builder during the build process.

这篇关于在AngularDart 5和Dart 2中使用SCSS样式文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆