我在 .scss 檔案中宣告了多個變數,我想將相同的變數讀取到我的 d3 圖表中,例如:
$body-color: #424656;
d3.select(…)
.append("path")
.attr("d", line(data))
.attr("stroke", "black")
例如在上面的代碼中,我想根據我的 .sccs 變數更改筆觸顏色
uj5u.com熱心網友回復:
試試這個 .attr("fill", var(--body-color)
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/462643.html
