There are new capabilities for symbolic icons introduced in the brand new gtk-4.22 (basically still svg, but with custom sugar on top) that allows to use accent as color name.
Looks like this for a <path>, here the stroke uses the accent color, with a fallback rgb(0,34,255) if not available:
Looking at the docs it seems that for symbolic icons only foreground/success/warning/error are supported in symbolic icons, not accent…
Does your icon have a -symbolic.svg suffix in its name? If yes try to just use .svg.
You may have to add fill='url(#gpa:foreground)' to the non-accent paths so they can get recolored.
Icons are currently in process of being replaced with a new system, that’s why everything is confusing. Accent support was itself added recently, and there is an old icon system and a new icon system (and a hybrid of old and new, aka old system but with stroke and accent support)
In theory there are 2 ways to do this, the old system supports class='accent' but it doesn’t seem to work in my testing. It did at some point, but ig it broke.
The new system (the gpa thing) works but you need nightly GTK (in theory 4.22 has it but it doesn’t seem to work in my testing, it’s possible that icon editor output just changed so much newer icons don’t work with 4.22 anymore) and it’s currently very new and experimental - doesn’t update when you change accent (I’ll file a bug), and icon editor crashes a lot. Overall I wouldn’t recommend using it just yet.
We’ll have a new icon system in libadwaita later, using gpa icons, and there will be an announcement detailing everything once that happens. Until then I’d just use older icons and override one of the other classes to be accent from CSS:
your-icon {
-gtk-icon-palette: error var(--accent-bg-color); /* or --accent-color, idk which one you want here */
}