On the following image, I have two spans: one with red border (around a part of the first line) and one with green borders (around a part of second and third line). The second span, as you see, correctly wrap in two line.
Then, I link those two spans ("display: relative" spans, of course) with corresponding red and green alpha backgrounds in ":before" pseudo-elements (for specific reasons linked to overlapping annotations specifications, not related to this topic), pseudo-elements constructed like this:
@mixin annotColors($color, $alpha) {
border-color: $color!important;
&:before {
content: '';
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: rgba($color, $alpha);
pointer-events: none;
}
}
$annot-base-alpha: .25;
&[data-annottype="dft"] { @include annotColors($color-annot-default, $annot-base-alpha); }
&[data-annottype="sugg"] { @include annotColors($color-annot-suggestion, $annot-base-alpha); }
&[data-annottype="good"] { @include annotColors($color-annot-good, $annot-base-alpha); }
&[data-annottype="err"] { @include annotColors($color-annot-error, $annot-base-alpha); }
&[data-annottype="hvy"] { @include annotColors($color-annot-heavy, $annot-base-alpha); }
&[data-annottype="xhw"] { @include annotColors($color-annot-comprehension, $annot-base-alpha);
And as you can see, the second (green) background does not fit its multilined span, but rather it's [left-first line, right-last line] zone. Would you have any idea how I could force that :before to "fellow" it multilined parents?
