I would like to know if it is possible to combine host-context with user states of elements. For instance:
<polymer-element name="my-element">
<template>
<style>
:host(:hover) {
background-color: blue; // For all other situations
}
:host-context(my-app) {
// TODO: Apply darkblue ONLY when my-element is hosted within my-app
// and the user state of my-element is hover.
background-color: darkblue;
}
</style>
Hello
</template>
<script src="my-element.js"></script>
</polymer-element>
I tried many combinations with the host context and: hover, but none of them work.
Thanks for any help in advance!
source
share