JSFiddle - React, Tailwind, and code Playground

HTML

<div id="test"> This is content </div>

CSS

div:after{
  content: '.';
  display: block;
  width: 200px;
  height: 200px;
  background: green;
}

JavaScript

var st = document.getElementById('test');
document.body.innerHTML += 'base element:'+window.getComputedStyle(st, null).backgroundColor;
document.body.innerHTML += '<br />';
document.body.innerHTML += ':after element:'+window.getComputedStyle(st, ':after').backgroundColor;