Plot text mark style

I want to style all text elements in a plot equally via css:

text {
      font-size: 12px;
      line-height: 125%;
      font-weight: 400;
      font-family: InterRegular
}

but also want to make exceptions and style text marks differently:

    Plot.text(inftime_produkt, Plot.selectLast({ 
      x: "date",
      y: max_inflation_round,
      z: "produkt",
      text: (d) => `${d.produkt.split(' ')[0]}: ${(d.inflation-100).toLocaleString("de", {minimumFractionDigits: 1,  maximumFractionDigits: 1})}%`,
      fill: "#e84f1c",
      textAnchor: "end",
      fontSize: "24px",
      lineHeight: "150%",
      fontWeight: 600,
      fontFamily: "InterRegular"
    }))

But these stylings are overwritten by css. How can I do this?

this is my notebook: Inflation Dashboard Test / RND | Observable

in your css try changing text by g:not([font-family]) text

1 Like

very nice, thank you!