material-ui - 在 Material-UI 中 $active 是什么意思?
问题描述
当我使用 Material-UI 滑块并对其进行自定义时,我在文档中找到了这段代码:
const AirbnbSlider = withStyles({
root: {
color: '#3a8589',
height: 3,
padding: '13px 0',
},
thumb: {
height: 27,
width: 27,
backgroundColor: '#fff',
border: '1px solid currentColor',
marginTop: -12,
marginLeft: -13,
boxShadow: '#ebebeb 0 2px 2px',
'&:focus, &:hover, &$active': {
boxShadow: '#ccc 0 2px 3px 1px',
},
'& .bar': {
// display: inline-block !important;
height: 9,
width: 1,
backgroundColor: 'currentColor',
marginLeft: 1,
marginRight: 1,
},
},
active: {},
track: {
height: 3,
},
rail: {
color: '#d8d8d8',
opacity: 1,
height: 3,
},
})(Slider);
起初我以为这是一个错字,但通过查看 MUI 源代码,有几次&$active
是使用的,而不是&:active
. 我想知道它做了什么,因为我在 CSS 中没有发现 $ 的任何用途,并且没有发现与此 $active 状态相关的变量。
&:active
和这里 和有什么不一样&$active
?
谢谢你的时间!
解决方案
推荐阅读
- visual-studio - Visual Studio“重建解决方案”命令
- c# - 如何从 exe 文件配置文件中读写?
- makefile - 忍者文件到makefile
- javascript - 当 console.log 作为参数传递时,它可以工作,但是当 array.push 传递参数时,它不起作用,为什么?
- python-3.x - 如何为 spacy 的自定义命名实体识别准备数据?
- assembly - 执行 ADDS PC, #-4 时会发生什么?无限循环?
- ios - SwiftUI 中列表的 isScrollEnabled 等价物是什么?
- python - 如何动态记录不同级别的消息?例如:logging.x("message") where x in ['warn',error',..]
- java - 在 Java 中引用使用第三方库的类
- stm32 - STM32上的单元测试