Does anyone know if its somehow possible to store custom properties in CSS that can be fetched in Javascript.
CSS defines that any property, value or selector prefixed with a hyphen (-) is considered custom and is considered valid. It is only up to the browser to allow these declarations to be put into the document.
In IE, its possible to fetch any property (custom or not) from the element.currentStyle hash. I tried doing a similar approach by using the getComputedStyle method for all the other browsers, but I can’t seem to fetch the custom properties (other than the browser specific ones).
#container {
-custom-value:111;
}
Does anyone know if this is possible somehow across all browsers?