Is there a way to get offsetLeft of a pseudo element using only javascript?
I can check the :: before element through the chrome devtools console and get its offsetLeft.
As window.getComputedStyle (elem, ': before') gives the computed for :: before styles, is there anything similar to offsetLeft access?
Yes, you can get the computed style for the pseudo-element, then get the left value of its bounding box:
parseInt(window.getComputedStyle(elem, ':before').getBoundingClientRect().left, 10);