【问题标题】:Where should I put react transition group style classes in scss?我应该将反应过渡组样式类放在 scss 中的哪个位置?
【发布时间】:2020-04-25 08:42:07
【问题描述】:

我应该将 react 过渡组样式类放在我的 scss 的什么位置?我想动画褪色。在实际检查后,我清楚地看到了附加的类,但没有任何效果。我想我几乎把它们放在任何地方。

有经验的吗?

#transitionGroupDiv{
    // gallery styles etc.

// NOT WORKING HERE
  .fade-enter {
    opacity: 0;
  }

  .fade-enter-active {
    opacity: 1;
    transition: opacity 10000ms ease-out;
  }

  .fade-leave {
    opacity: 1;
  }

  .fade-leave-active {
    opacity: 0;
    transition: opacity 10000ms ease-out;
  }

    .element{
        // other styles etc.

    }
}

【问题讨论】:

    标签: reactjs sass styles react-transition-group


    【解决方案1】:

    我实际上并不知道 scss 规则。您必须使用父选择器引用&。 此问题中的示例:SO question。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-06-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多