angular 过滤为css,angular-cli CSS 预处理器集成

CSS Preprocessor integration

CSS 预处理器集成

Angular CLI supports all major CSS preprocessors:

Angular CLI 支持所有anjor css 预处理器:

To use these preprocessors simply add the file to your component's styleUrls:

要使用这些预处理器只需将文件添加到组件的 styleUrls:

@Component({

selector: 'app-root',

templateUrl: './app.component.html',

styleUrls: ['./app.component.scss']

})

export class AppComponent {

title = 'app works!';

}

When generating a new project you can also define which extension you want for

style files:

在生成新项目时,您还可以定义样式文件所需的扩展名:

ng new sassy-project --style=sass

Or set the default style on an existing project:

或者在现有项目上设置默认样式

ng config schematics.@schematics/angular:component.styleext scss

# note: @schematics/angular is the default schematic for the Angular CLI

Style strings added to the @Component.styles array must be written in CSS because the CLI cannot apply a pre-processor to inline styles.

添加到@ Component.styles数组的样式字符串必须用CSS编写,因为CLI不能将预处理器应用于内联样式。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值