JSFiddle - React, Tailwind, and code Playground

HTML

<div>
  <div>
  </div>
</div>
<output id='op'><</output>

CSS

div {
  width: 300px;
  height: 250px;
  background: green;
}
div > div {
  width: 200px;
  padding-top: 5%;
  height: 200px;
  background: red;
}

JavaScript

window.onload = function(){
	var op = document.getElementById('op');
  var el = document.querySelector('div > div');
  op.textContent = 'Padding Top: ' + window.getComputedStyle(el).paddingTop;
}