问题描述
你能告诉我如何将 scss 文件添加到 stackblitz.我试过了.但它不起作用.请查看并告诉我.
Can you tell me how to add scss file to the stackblitz. I tried that.But it is not working. Please see that and let me know.
我已尝试添加 home.html
这是项目: stackblitz一个>
推荐答案
Scss 应该可以在 stackblitz 中工作:
@Component({
selector: 'page-home',
templateUrl: 'home.html',
styleUrls: [ './home.scss' ] <== add this
})
export class HomePage {
样式类似
page-home {
.buttoncls {
不适用于默认封装(ViewEncapsulation.Emulated),因为 page-home 不是 home 组件模板的一部分,并且Angular 将 [_ngcontent-c0] 之类的属性添加到样式中.
won't work for you with default encapsulation(ViewEncapsulation.Emulated) because page-home is not part of home component template and angular adds attribute like [_ngcontent-c0] to styles.
所以我们可以把 page-home 改成 ion-list 看看它是怎么工作的:
So we can change page-home to ion-list and see how it works:
Stackblitz 示例(ViewEncapsulation.Emulated)
但是我们可以禁用封装:
But we can disable encapsulation:
encapsulation: ViewEncapsulation.None
Stackblitz 示例(ViewEncapsulation.None)
另请参阅此主题
https://github.com/stackblitz/core/issues/1
正如 EricSimons 9 天前评论的那样:
As EricSimons commented 9 days ago:
大家好!我们刚刚发布了 SASS 和 LESS 支持,我们还支持angular-cli.json 配置也是 :)
Hey all! We just shipped SASS and LESS support, and we also support the angular-cli.json config too :)
这篇关于将 scss 文件添加到 Stackblitz的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!




大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)