使用包含斜杠和冒号的属性选择器时,出现了重复的CSS规则

问题描述 投票:0回答:1

我有一个非常基本的选择器,其中包含一些斜杠和冒号:

[data-sitemap-state="/register/:/"] {
  @include typography;
}

我使用的是gulp-sass,据我所知,它使用的是node-sass,因此使用的是lib-sass

mixin(typography)看起来像这样:

@mixin typography {

  font-weight: 700;
  font-size: 1.25em;

}

构建SCSS时,会生成以下CSS:

[data-sitemap-state="/register/:/"],
[data-sitemap-state="/register/.\:/"] {
  font-weight: 700;
  font-size: 1.25em;
}

我不明白为什么会生成附加选择器:

[data-sitemap-state="/register/.\:/"]

特别是.\:/

我尝试转义冒号字符,并对冒号使用unicode / hex值,并且无论如何都会生成相同的CSS。

我期待这个输出:

[data-sitemap-state="/register/:/"] {
  font-weight: 700;
  font-size: 1.25em;
}
sass gulp-sass node-sass scss-mixins
1个回答
0
投票

可能为IE8支持创建了此附加规则。

© www.soinside.com 2019 - 2024. All rights reserved.