JSFiddle - React, Tailwind, and code Playground
HTML
<div id="foo" class="test">should grow on both axis</div>
<div id="bar" class="test">should grow on both axis</div>
CSS
.test {
background: red;
width: 100px;
height: 100px;
margin: 0 0 10px;
}
#foo { background: #9F6; }
#bar { background: #FF6; }
JavaScript
setInterval(function(){
$('#foo').css({
width: '+=2',
'padding-top': '+=2'
});
$('#bar').css({
height: '+=2',
paddingLeft: '+=2px',
});
}, 150);