Accepted answer

If you're using D3 v5 (and possibly v4) the default styling is now embedded at the element level, which saves you having to specify it yourself in CSS. One way to get over this is to override it with CSS's !important flag.

.x.axis line {
    stroke: gray !important;

Alternatively re-apply it to the elements after calling the axis using d3:

d3.selectAll(".x.axis line")

A little finessing may be required, but the principle should work.

Related Query

More Query from same tag