Line background color and selection layering

Heya,

I have a question regarding a small problem that has to do with the way line styles are applied in v6. In v5, you could select a line or wrap element to apply a class to a full line. By choosing the wrap class, you could style the containing element of some lines and apply, e.g., a background color to it. Then, if you selected something, you could first see the line’s background color, then the selection, and finally the text.

With the more lean DOM that v6 produces, there is no more wrapping, and hence the background color must be applied directly to the text layer.

This causes the problem that selections cannot be seen if the background color is not translucent, since the selection layer is positioned behind the line elements (and if you manually play around with the z-index of the selection, it’s either in front of the text or behind the background). I’m btw using the drawSelection extension.

Now, my question is: Is there an easy fix to this to kind of “reenable” that older behavior, or will background colors naturally interfere with the selections? In the latter case I can make the background color slightly translucent, but if there’s a way of having a background color layer, THEN the selection layer and then the text layer, that would be awesome.

Thanks in advance! :slight_smile:

1 Like

Have to use transparent backgrounds, or use the layer feature to display a separate element behind the selection layer.

1 Like

Thank you! I’ll have a look at the layer feature!

Hej,

Quick update: I’ve now used the layer feature and it was exactly what I needed! Thank you again!

Hi @hendrikerz, I’ve run into this same issue but finding it hard to make sense of how to use the layer feature to fix this. Would you be able to share a short snippet or some pointers? Thanks