Forum Bugs

Prince doesn't know :host selector, invalidating style blocks that use this selector

sander
I have a piece of a document that I would like to use with Prince, as well as in a shadow dom component on a website. The corresponding CSS sets some styles on the `:host` component for the shadow dom.

Prince apparently doesn't know `:host`, so in the following example, the entire ruleset is considered invalid:
<style>
  p, :host {
    background: red;
  }
</style>

<p>This is a test.</p>


I imagine Prince doesn't support shadow dom and I don't know if there are plans to add that. For now it would be helpful if it could just ignore the `:host` selector instead of treating it as invalid.

Edited by sander

dauwhe
I believe doing so would go against the relevant CSS specification:

NOTE: Consistent with CSS’s forwards-compatible parsing principle, UAs must treat as invalid any pseudo-classes, pseudo-elements, combinators, or other syntactic constructs for which they have no usable level of support. See Partial implementations.