Read the content of a pseudo-element.
npm install pseudo-content
@media (max-width: 414px) {
#foo:before {
content: 'mobile';
}
}
var foo = document.getElementById('foo');
// as second parameter you can pass the pseudo element as string - 'before' or 'after'
var fooPseudoContent = pseudoContent(foo);
console.log(fooPseudoContent.get()); // mobile
console.log(fooPseudoContent.is('mobile')); // true