简体   繁体   English

是否可以将全局 styles.css 文件转换为 styles.scss?

[英]Is it possible to convert the global styles.css file to styles.scss?

I have an application that was build using the Angular CLI, Angular version 11. I have some directives in my application that require specific css classes.我有一个使用 Angular CLI、Angular 版本 11 构建的应用程序。我的应用程序中有一些指令需要特定的 css 类。 Rather than have separate scss files for each directive I would like to add the scss classes to the styles.css contained in the application root.我不想为每个指令使用单独的 scss 文件,而是将 scss 类添加到应用程序根目录中包含的 styles.css 中。 However I can't do this as the styles.css file is css and not scss.但是我不能这样做,因为 styles.css 文件是 css 而不是 scss。 Is there a way I can convert this file to scss?有没有办法可以将此文件转换为scss?

I just manually changed the file extension and changed the reference in the angular.json file in the { "architect": { "build: { "styles": } } } property - so far I have experienced no unexpected behavior or errors我只是手动更改了文件扩展名并更改了{ "architect": { "build: { "styles": } } }属性中 angular.json 文件中的引用 - 到目前为止,我没有遇到任何意外行为或错误

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM