Specific CSS selector to highlight incomplete stuff
Posted: Fri Sep 09, 2022 4:20 pm
I'd like to tweak the default Author css file to highlight images without the ALT attribute and also those with the ALT, but containing a comment inside.
Correct:
Incorrect:
Incorrect:
So I have the rule which highlights every image:
And there is a complementary rule which clears highlighting in specific conditions. I am able to detect the existence of the ALT element, but I can't subtract cases when this element contains a comment (to keep the third example highlighted).
Is something like this possible in Oxygen CSS?
Correct:
Code: Select all
<inlinemediaobject>
<imageobject>
<imagedata fileref="icon.svg"/>
</imageobject>
<alt>Print</alt>
</inlinemediaobject>
Code: Select all
<inlinemediaobject>
<imageobject>
<imagedata fileref="icon.svg"/>
</imageobject>
</inlinemediaobject>
Code: Select all
<inlinemediaobject>
<imageobject>
<imagedata fileref="icon.svg"/>
</imageobject>
<alt><!-- FIXME --></alt>
</inlinemediaobject>
Code: Select all
inlinemediaobject {
background-color: coral;
}
Code: Select all
/* this rule doesn't cover the third case
inlinemediaobject:has(alt) {
background-color: inherit;
}
*/
/* this rule also doesn't cover third case
inlinemediaobject:has(alt:not(oxy|comment)) {
background-color: inherit;
}