Home > Software engineering >  How to read variables declared in .scss files in to d3 charts
How to read variables declared in .scss files in to d3 charts

Time:04-14

I have multiple variables declared in .scss file i want to read same variables in to my d3 charts ex:

$body-color: #424656;

    d3.select(…)
  .append("path")
  .attr("d", line(data))
  .attr("stroke", "black")

for example in above code i want to change stroke color as per my .sccs variable

CodePudding user response:

Try this .attr("fill", var(--body-color)

  • Related