0

即使有多个路径,我也想显示一个图标。我知道我可以通过将所有路径合并到最少 2 个路径来实现这一点,在其中我可以使用之前和之后使用 HTML 元素显示图标,我只需要传递类名和 iframe,我可以它在我的屏幕上可见。

所以我有所有这些路径只是一个图标。即使使用所有这些路径,如何使图标可见。

.icon-claus-santa-xmas-christmas-svgrepo-com .path1:before {
  content: "\e900";
  color: rgb(255, 96, 150);
}
.icon-claus-santa-xmas-christmas-svgrepo-com .path2:before {
  content: "\e901";
  margin-left: -1em;
  color: rgb(255, 255, 255);
}
.icon-claus-santa-xmas-christmas-svgrepo-com .path3:before {
  content: "\e902";
  margin-left: -1em;
  color: rgb(255, 64, 129);
}
.icon-claus-santa-xmas-christmas-svgrepo-com .path4:before {
  content: "\e903";
  margin-left: -1em;
  color: rgb(252, 228, 236);
}
.icon-claus-santa-xmas-christmas-svgrepo-com .path5:before {
  content: "\e904";
  margin-left: -1em;
  color: rgb(240, 250, 255);
}
.icon-claus-santa-xmas-christmas-svgrepo-com .path6:before {
  content: "\e905";
  margin-left: -1em;
  color: none;
}
.icon-claus-santa-xmas-christmas-svgrepo-com .path7:before {
  content: "\e906";
  margin-left: -1em;
  color: none;
}

我正在考虑使用 vanilla JavaScript 并通过动态获取图标的名称并查找所有这些路径的 CSS 来逐层构建图标。

那可能吗?如果不是,最好的路径(:D)是什么?

4

0 回答 0