We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7141d5a commit 5b0ae7dCopy full SHA for 5b0ae7d
src/json_writer.rs
@@ -52,11 +52,13 @@ impl JsonWriter {
52
Some({
53
// 识别伪类
54
let mut new_selector = rule_item.selector.selector.clone();
55
- let key_arr = new_selector.split(":").collect::<Vec<&str>>();
56
- if key_arr.len() == 2 {
57
- new_selector = key_arr[0].to_string();
+ // 特殊处理:root选择器
+ if new_selector != ":root" {
+ let key_arr = new_selector.split(":").collect::<Vec<&str>>();
58
+ if key_arr.len() == 2 {
59
+ new_selector = key_arr[0].to_string();
60
+ }
61
}
-
62
let nesting_selector = utils::split_selector(&new_selector);
63
let mut lit_props = vec![
64
PropOrSpread::Prop(Box::new(Prop::KeyValue(KeyValueProp {
0 commit comments