question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[es-dev-server] CustomStyleInterface polyfill is missing

See original GitHub issue

When serving to legacy browsers, the ShadyCSS.CustomStyleInterface polyfill is not loaded. This means external CSS Variables cannot be used to style elements.

<style>
  my-custom-element {
    --my-prop: red;
  }
</style>

<my-custom-element>
  <!-->begin: shadow<-->
  <style>
    :host {
      color: var(--my-prop, blue);
    }
  </style>
  <slot></slot>
  <!-->end: shadow<-->
  Colour should be red.
</my-custom-element>

<script>
  ShadyCSS.CustomStyleInterface.addCustomStyle(document.querySelector('style'));
</script>

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
LarsDenBakkercommented, Feb 6, 2020

With https://github.com/open-wc/open-wc/pull/1292 there is an option to configure to load this

2reactions
daKmoRcommented, Feb 6, 2020

and it’s released 🎉

Read more comments on GitHub >

github_iconTop Results From Across the Web

open-wc/es-dev-server - GitHub
You can customize the polyfill loader configuration from your configuration file. Check the docs for the polyfills-loader for all possible options. module.
Read more >
es-dev-server - npm
Development server for modern web apps. Latest version: 2.1.0, last published: 2 years ago. Start using es-dev-server in your project by ...
Read more >
Can't resolve polyfill packages in project dependencies after ...
This is a non-trivial migration, so it cannot be said that my additions will definitely help, but at least an extra chance.
Read more >
Developing Without a Build (2): es-dev-server
In this article, we will look into how we can set up es-dev-server , and how it can help us developing without a...
Read more >
ESLint checks for missing polyfills in your web apps ... - Medium
I've seen several Frontend teams who were facing issues related to browser support for some of our features in the past.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found