There is no “right” way to do CSS since there are many ways to do the same thing, but that looks good to me. When putting code in the forum (or using markdown), you can put it between three back ticks on each side (press the same key as tilde or ~, but don’t press shift), which will format your code better. If you want the color to only work for a light or dark theme, you can put the CSS classes: .theme-dark or .theme-light before one of your other specifiers. For example, if you only wanted to make .graph-view.color-circle show when you have a dark theme, you could do:
.theme-dark .graph-view.color-circle {
color: var(–background-primary-alt) !important;
}
If you don’t feel like messing around with CSS, you could just make some graph filters and change the colors there.