Can anyone explain how to implement the CSS shown below in JavaScript?
#absoluteCenter {
left: 50% !important;
top: 50% !important;
-webkit-transform:translate(-50%,-50%)!important;
-moz-transform:translate(-50%,-50%)!important;
-ms-transform:translate(-50%,-50%)!important;
-o-transform:translate(-50%,-50%)!important;
transform:translate(-50%,-50%)!important;
}
I would like to convert this CSS into an object format so that I can pass it as a style object to a component. The format should be like this:
var styles = {
style: property
}
Note: I am using ReactJS, and these properties are configured before the Component is rendered on the DOM. This is why I cannot use document.getElementById()