Styling NodeView within a SelectionRange

The selectNode/deselectNode methods on the NodeView work great for handling custom styles for single node selections, but I am not seeing a way to handle this when the element is inside of a SelectionRange. In the case of one of my node views the only visible element when the node isn’t directly selected in a canvas element and it doesn’t get any selection styling from the browser. I am no CSS expert, but I also haven’t found a working CSS only solution. This is especially bad when it is the last node in the selection and there is no way of telling if the selection ends before or after the node.

Does anyone have advice/suggestions for the best way to handle this? It doesn’t seem possible just using the NodeView interface since update only gets called with the node changes and selectNode/deselectNode on get called with node selections.

I think the best way to do this is to have a plugin iterate over the selection to make sure every relevant node has a node decoration (of a given, specific type) attached to it, and have the node view’s update method adjust its style depending on the presence or absence of such decorations.

Thanks for the tip. I will give that a try.