我正在尝试在我的 Shopify 商店中添加一个样式表,它的开头有 @import "compass/css3"并且它没有导入 compass/css3,我得到的错误是: 拒绝应用来自“https://cdn.shopify.com/xx/xxxx/xxx/assets/compass/css3”的样式' 因为它的 MIME 类型('text/html')不是受支持的样式表 MIME 类型,并且启用了严格的 MIME 检查。
请帮我解决一下
当我尝试打开此文件时,它显示错误“抱歉,找不到您要查找的页面。”
@import "compass/css3";
最佳答案
出现此错误是因为 Shopify 无法编译您的 SASS 文件。根据这篇关于 Shopify website 的文章
If you’re letting Shopify compile your Sass file for you, Shopify doesn’t support the @import directive.
一个推荐的解决方案是
If you want to use multiple Sass partials and the @import directive, you will have to compile your Sass locally using an app like CodeKit or Prepros, or a task runner like Gulp or Grunt — then sync the files to your theme using Theme Kit.
关于css - 拒绝应用来自 "https://cd.shopify.com/xxxxx/assets/compass.css3"的样式,因为它的 MIME 类型为 ('text/html' ),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54413927/