简体   繁体   English

@keyframes 中的 SCSS @extend 不起作用

[英]SCSS @extend in @keyframes is not working

im trying to create two keyframes animations which replace the content attribute of a pseudo element.我试图创建两个关键帧动画来替换伪元素的内容属性。 Unfortunately, it looks like the @extend feature of SCSS is not working within @keyframes .不幸的是,看起来 SCSS 的@extend功能在@keyframes中不起作用。 Did i miss something?我错过了什么?

Code: ( open animation does not work, close does).代码:(打开animation 不起作用,关闭是)。

@keyframes open {
  0% {
    @extend .icon-after-arrow-down;
  }
  50% {
    color: transparent;
  }
  100% {
    @extend .icon-after-arrow-up;
  }
}

@keyframes close {
  0% {
    content: '\e905';
  }
  50% {
    color: transparent;
  }
  100% {
    content: '\e902';
  }
}

Solved by comment from @Arkellys "@extend is when you need to chains classes, you should use mixins for this case." @Arkellys 的评论解决了“@extend 是当您需要链接类时,您应该在这种情况下使用 mixins。”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM