【发布时间】:2022-09-27 23:44:43
【问题描述】:
所以我正在使用 BigCommerce 的 StencilCLI,我随机开始弹出一个指向我的自定义 sass 文件的错误。它指向以下代码:
.container {
@include breakpoint(\"medium\") {
max-width:106rem;
}
@include breakpoint(\"large\") {
padding: 0 3rem;
}
}
当我将它推送到 github 时,这给了我以下错误,
Validating theme...
/opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@bigcommerce/stencil-cli/lib/bundle-validator.js:429
throw new Error(
^
Error: no mixin named breakpoint
Backtrace:
stdin:25
on line 25 of stdin
>> @include breakpoint(\"medium\") {
-------------^
: while compiling css files from \"/home/runner/work/maz/maz/assets/scss/_custom.scss\".
at BundleValidator._validateCssFiles (/opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/@bigcommerce/stencil-cli/lib/bundle-validator.js:429:23)
Error: Process completed with exit code 1.
在研究有关导入 mixin 的错误代码时,我已经阅读了很多内容,但我不确定将它放在哪里,或者为什么我需要这样做,或者它是否已经完成。它并不总是抛出此错误,并且许多其他 scss 文件在其文件中使用相同的 @include 断点(“大/中/小”)代码,但它们都没有抛出错误。
我能找到的最接近的文件看起来像是导入断点 mixin 是这个 javascript 文件:
const breakpointSizes = {
large: 1261,
medium: 876,
small: 551,
};
任何解释我需要做什么的帮助都会有所帮助,描述性越强越好。
标签: javascript sass breakpoints bigcommerce scss-mixins