css - 拒绝应用来自 "https://cd.shopify.com/xxxxx/assets/compass.css3"的样式,因为它的 MIME 类型为 ('text/html' )

标签 css sass shopify stylesheet compass

我正在尝试在我的 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/

相关文章:

html - 使用 css 裁剪和居中图像

javascript - 将图像与其 ALT 链接

dns - 显示错误域名的搜索结果

css - 将 css 媒体查询组合在一起有优势吗?

html - 对奇数 div 应用不同的样式

Jquery - 将下拉菜单转换为单选按钮

html - 显示与浏览器不同的简单电子邮件 CSS

css - 有没有办法用 css 3 做到这一点?

html - Bootstrap : Two Divs in a row are not getting aligned properly

javascript - 我不能用 JS 操作 CSS 显示属性?