If that works for you, go with it.
There’s also a variable, --caret-color, so you could easily do
.theme-light {
--caret-color: salmon;
}
.theme-dark {
--caret-color: gold;
}
to set separate colors depending on if you’re in the light or dark color scheme.