【发布时间】:2017-12-21 09:40:31
【问题描述】:
使用 LESS 预处理器和 shadow-dom 来支持单个组件的主题化。我也尝试过嵌套 :host-context 和 :host 选择器,但无济于事。
:host-context(.dark) {
@import (multiple) 'variables/dark-theme';
.dropdown;
}
:host-context(.light) {
@import (multiple) 'variables/light-theme';
.dropdown;
}
.dropdown() {
//some component styles here
&:disabled {
background-color: @disabled-bg;
color: @disabled-color;
.dropDownListSelect {
cursor: not-allowed;
}
}
}
【问题讨论】:
标签: css css-selectors less shadow-dom