Component CSS引入@component选择器
标题:component-css:将@component选择器引入CSS
组件CSS(CCSS)将@component选择器引入CSS。最初作为React特定的CSS预处理器发布,现在正在转变为一个通用概念。使用嵌套组件开发网站时,@component可以使选择器仅影响目标组件,避免命名冲突。
例如,使用以下代码:
@component Example{
width:100%;
height:100%;
.content{
width:100%;
}
}
将生成如下CSS:
.app-component.app-example{
width:100%;
height:100%;
}
.app-component.app-example.app-example_content{
width:100%;
}
下载地址
用户评论