【问题标题】:no mixin named transition-duration没有名为 transition-duration 的 mixin
【发布时间】:2022-01-24 07:24:16
【问题描述】:

我正在从 Bootstrap 3 迁移到 Bootstrap 4。所以我正在将 LESS 文件转换为 SCSS。我使用this 来转换我的文件。

但是,我得到的错误是:no mixin named transition-duration

charts.less

.mini-charts-item {
    -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
    -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
    position: relative;
    margin-bottom: 30px;

    &:before {
        .transition(width);
        .transition-duration(500ms);
        .backface-visibility(hidden);
        content: "";
        width: 113px;
        height: 100%;
        background: rgba(0,0,0,0.1);
        position: absolute;
        left: 0;
        top: 0;
    }
}

charts.scss

.mini-charts-item {
    -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
    -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
    position: relative;
    margin-bottom: 30px;

    &:before {
        content: "";
        width: 113px;
        height: 100%;
        background: rgba(0,0,0,0.1);
        position: absolute;
        left: 0;
        top: 0;
        @include transition(width);
        @include transition-duration(500ms);
        @include backface-visibility(hidden);
    }
}

【问题讨论】:

    标签: css sass less


    【解决方案1】:

    'transition-duration' 不是 mixin。它是动画的内置 css 属性。您可以使用它而无需包含它。更多信息可以参考[此链接]。1

    【讨论】:

    猜你喜欢
    • 2016-05-30
    • 2013-07-21
    • 2023-03-22
    • 1970-01-01
    • 2011-08-27
    • 2016-12-20
    • 2020-02-19
    • 1970-01-01
    • 2018-12-28
    相关资源
    最近更新 更多