CSS custom property mixins are not evaluated when used with css helper function in lit-element static styles property.
I encountered this issue while moving an app to lit-element from Polymer 3. Since there seems to be no real lit alternative to paper elements (mwc components are not ready at all), the idea was to keep using paper elements with custom styles.
Wrapping the CSS definition that includes the custom property mixin definition in a <style></style> element that is itself put at the top of html helper function is a workaround for the stackblitz demo I shared. Unfortunately, this does not work in a more complex app. I am still trying to understand what's the cause/difference.
https://stackblitz.com/edit/lit-element-custom-properties-css-helper-styles
See line 15 from index.js in live demo. Paper-input elements have their style customized using the custom property mixin --paper-input-container-input. Unfortunately, the style does not apply.
Paper input with red border and text input color.
Paper input uses its default style.
@apply never got standardized. We're not going to add support in more places.
Right now ::part is the facility for cross scope styling, we're working on cross browser support now, and we're trying to get some progress happening with ::theme for deep theming.
Until then you can use style tags in your render result. They still work.
Closing based on @justinfagnani 's comment.
Most helpful comment
@applynever got standardized. We're not going to add support in more places.Right now
::partis the facility for cross scope styling, we're working on cross browser support now, and we're trying to get some progress happening with::themefor deep theming.Until then you can use style tags in your render result. They still work.