Dynamic style the host #3180
Unanswered
barsdeveloper
asked this question in
Q&A
Replies: 1 comment
-
Another way to do per-instance styling with with a |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Which package is this a feature request for?
Lit Core (lit / lit-html / lit-element / reactive-element)
Description
I see a way to specify the style is through the use of the static style property. The problem is that I want to set the style of the component/host itselt (set the value of a css variable from a dynamic property). The documentation mentions the use of styleMap in the render() method https://lit.dev/docs/components/styles/#dynamic-classes-and-styles the problem is that I cannot access the component in the render method. Do you have any suggestion to set a css variable on the host itself?
Alternatives and Workarounds
The css function attr would solve this issue (use the value of a html attribute in css) but it is not yet implemented by any browser apparently.
Beta Was this translation helpful? Give feedback.
All reactions