I am working on a concept for the communication between SASS and Javascript. The special thing is that my SASS variables change whole layouts. Of course the Javascript should notice this.
Javascript can not read SASS variables, so far clearly.
However, I can generate CSS variables by switching SASS variables on and off.
CSS variables can now be read with Javascript. Conversely, I know if the SASS variable is on or off.
IE11 can not read CSS variables reasonably, as far as clear. Pollyfill e.g. IE11 - does a polyfill / script exist for CSS variables? solve this problem. If it wasn't for the big overhead. I dont want to use them at all.
My idea is to add non-existing CSS properties to the HTML tag. Like html { stackoverflow: true }
. Now I can read this with Javascript.
Of course I have a browser recognition, so I can set the CSS instructions only for IE. E.G. html.browser-msie { stackoverflow: true }
. So my CSS is not garbage for the other browsers.
What do you say? What unexpected consequences do I have if I write CSS commands that do not exist?