CSS custom properties polyfill for ie11

前端 未结 4 1366
無奈伤痛
無奈伤痛 2021-02-18 18:31

Is there a way to pollyfill a custom CSS property for ie11 with JavaScript? I was thinking on load, check if browser supports custom properties and if not do some kind of find a

4条回答
  •  故里飘歌
    2021-02-18 18:59

    The Webcomponents library has polyfills that (among other things) provide custom property/CSS variables support to IE11. Note that the whole library is quite much, since it also polyfills custom HTML elements, HTML imports and shadow DOM.

    https://www.webcomponents.org/polyfills

    https://github.com/WebComponents/webcomponentsjs

提交回复
热议问题