Workaround for CSS variables in IE?

后端 未结 10 1770
Happy的楠姐
Happy的楠姐 2020-12-13 17:02

I\'m currently developing a web application in Outsystems in which I have the need to customize the CSS, in which I\'m using variables. I need to guarantee the app works cro

10条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-13 17:41

    Yes, so long as you're processing root-level custom properties (IE9+).

    • GitHub: https://github.com/jhildenbiddle/css-vars-ponyfill
    • NPM: https://www.npmjs.com/package/css-vars-ponyfill
    • Demo: https://codepen.io/jhildenbiddle/pen/ZxYJrR

    From the README:

    Features

    • Client-side transformation of CSS custom properties to static values
    • Live updates of runtime values in both modern and legacy browsers
    • Transforms ,

      Transforms web components / shadow DOM

      
        #shadow-root
          
          
      Hello.

      For the sake of completeness: w3c specs

      Hope this helps.

      (Shameless self-promotion: Check)

提交回复
热议问题