Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

当使用关键帧动画的时候,提示 no mixin named keyframes #1

Open
thethreeonee opened this issue Nov 26, 2014 · 3 comments
Open

Comments

@thethreeonee
Copy link

你好,
我在我的 scss 文件里这么写:

@import "compass/css3";

@include keyframes(breatharrow) {
  0%    {@include opacity(0.2);}
  25%   {@include opacity(0.3);}
  50%   {@include opacity(0.4);}
  100%  {@include opacity(0.5);}
}

编译的时候提示
no mixin named keyframes

@qdsang
Copy link
Owner

qdsang commented Nov 26, 2014

估计是 使用的compass版本太旧了。 我更新下试试。
旧版本中貌似没有keyframes函数

@qdsang
Copy link
Owner

qdsang commented Nov 26, 2014

fex-team/fis-parser-sass#12
fex-team/fis-parser-sass#14
推测是 libsass 目前还不支持 compass 新版使用的sass语法

如果要用 keyframes 可以自己写一个函数

@mixin keyframes($animation-name) {
  @-webkit-keyframes $animation-name {
    @content;
  }
  @-moz-keyframes $animation-name {
    @content;
  }
  @keyframes $animation-name {
    @content;
  }
}

@mixin animation($str) {
  -webkit-animation: #{$str};
  animation: #{$str};
}

@thethreeonee
Copy link
Author

好的,只能先自己写了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants