JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<main>
<section></section>
</main>
CSS
main {
width:100%;
}
main aside {
width:300px;
background:red;
min-height:300px;
float:left;
}
main section {
width:100%;
background:green;
min-height:300px;
float:left;
}
.haveSidebar main section {
width: calc(100% - 300px);
}
JavaScript
var sideBar = $('body > main > aside');
if (sideBar.length > 0) {
$('body').addClass('haveSidebar');
} else {
$('body').removeClass('haveSidebar');
}