Workaround for CSS variables in IE?

后端 未结 10 1779
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 18:08

    Make a seperate .css file for your variables. Copy/paste the contents of the variable.css file to the end of your main.css file. Find and replace all the variable names in the main.css file to the hex code for those variables. For example: ctrl-h to find var(--myWhiteVariable) and replace with #111111.

    Side note: if you keep the :root{ } in the main.css file and just comment it out, you can use that to track those hex codes later if you want to update your fallback colors.

提交回复
热议问题