gpt4 book ai didi

css - SASS 错误 : Properties are only allowed within rules, 指令、mixin 包含或其他属性

转载 作者:行者123 更新时间:2023-11-28 09:10:54 24 4
gpt4 key购买 nike

错误: @import "./styles/mixins"; ^ 属性只能在规则、指令、mixin 包含或其他属性中使用。

我的 scss 文件就是这么简单:

@import "./styles/mixins";

// There shouldn't be anything else
// Set my variables


@import "styles/variables";

@import "styles/core-style";

@include font-importer("Raleway Regular",'normal',400,"./assets/fonts/Raleway/Raleway-Regular.ttf");
@include font-importer("Raleway Bold",'normal',700,"./assets/fonts/Raleway/Raleway-Bold.ttf");
@include font-importer("Raleway Light",'normal',300,"./assets/fonts/Raleway/Raleway-Light.ttf");
@include font-importer("Raleway Medium",'normal',500,"./assets/fonts/Raleway/Raleway-Medium.ttf");

这是什么意思?我不明白 Sass 错误。我不明白在哪里看。我必须做什么?

谢谢,

史蒂芬。

最佳答案

您的font-importer 返回什么?

错误解释:

Properties are only allowed within rules, directives, mixin includes, or other properties.

这意味着你在 css 选择器之外调用你 mixin。
例如,此代码将产生相同的错误:

@mixin color() {
color: red;
}

@include color(); // call mixin without css selector

关于css - SASS 错误 : Properties are only allowed within rules, 指令、mixin 包含或其他属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48558206/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com