【问题标题】:Trying to convert CSS overlay feature to JSS in React尝试在 React 中将 CSS 覆盖功能转换为 JSS
【发布时间】:2018-05-13 13:14:31
【问题描述】:

这是我要转换的 CSS:

    .container {
  some CSS in here - figured that out 
}



.overlay {
  some CSS i can convert - not sure on below line
  transition: .5s ease;
}

这是我最苦恼的 CSS

.container:hover .overlay {
  height: 100%;
}

这是我的 JSS - 在悬停效果方面不起作用:

  container: {
    position: 'relative',
    width: '100%',
    '&:hover, &:overlay': {
      height: '100%',
      border: 'solid red'
    }
  },
  overlay: {
    position: 'absolute',
    bottom: 0,
    left: 0,
    right: 0,
    backgroundColor: '#008CBA',
    overflow: 'hidden',
    width: '100%',
    height: 0,
    transition: ['.5s', 'ease']
  },

我不知道如何转换 .container:hover .overlay 部分?我在 JSS 游乐场网站上搜索,但无法到达任何地方。我在想这只是一个嵌套问题,但它可能更明显。只是盯着同一个问题太久。

【问题讨论】:

标签: css reactjs jss


【解决方案1】:

你想要'&:hover $overlay'

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-11-17
    • 2021-01-24
    • 1970-01-01
    • 2019-05-06
    • 2015-10-03
    • 1970-01-01
    • 2023-03-03
    • 2011-10-24
    相关资源
    最近更新 更多