JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="http://dl.dropbox.com/u/1722364/Stack%20Overflow/jquery-ui.css">
<div id="debug">
jQuery UI will be applied to these buttons after a 5 second timeout
</div>
<div class="example">
This is what happens with the button class to
emulate jQuery UI <b>without running jQuery UI</b>
<br/>
<a class="button" href="#"><a/></a>
<button class="button" type="button"><button/></button>
<input class="button" type="button" value="<input/>"/>
<div style="padding:10px 0 0 40px; color:red;">NB: this is pure css emulation using the "button" class, no javascript!</div>
</div>
<div class="example">
This is what happens when you use the button class to
<b>emulate jQuery UI until it loads</b>
<br/>
<a class="button apply-ui-after-delay" href="javascript:;"><a/></a>
<button class="button apply-ui-after-delay" type="button"><button/></button>
<input class="button apply-ui-after-delay" type="button" value="<input/>"/>
</div>
<div class="example">
This is what we'd get if we apply the UI classes ahead of time
<br/>
<a class="apply-ui-after-delay ui ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" href="javascript:;"><a/></a>
<button class="apply-ui-after-delay ui ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"><button/></button>
<input class="apply-ui-after-delay ui ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" type="button" value="<input/>"/>
</div>
<div class="example">
And this is the worst case scenario...
<br/>
<a class="apply-ui-after-delay" href="javascript:;"><a/></a>
<button class="apply-ui-after-delay"><button/></button>
<input class="apply-ui-after-delay" type="button" value="<input/>"/>
</div>
<div class="example">
<b>NB.: If you want the css to apply to all buttons and not only the ones with the "button"...
CSS
/* ignore this css, I'm just making the demo readable */
body{padding:20px;font-size:9.0pt;font-family:Arial;}
.example{border-top:#ccc dotted 2px;margin-bottom:15px;padding-top:10px;}
#debug{padding:10px;background:#fc0;color:#900;font-weight:bold;}
/* the css you need is below this line */
.button{
cursor:pointer;
display:inline-block;
line-height:1.4;
margin: 0 0.1em 0 0;
padding: 0.3em 1em 0.4em;
border: 1px solid #ccc;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1), 0 0 1px #FFF inset;
-moz-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1), 0 0 1px #FFFFFF inset;
-webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1), 0 0 1px #FFF inset;
color: #666;
background: #EFEFEF;
text-decoration: none;
text-align: center;
font-family: Segoe UI, Trebuchet MS, Tahoma, Arial, sans-serif;
font-size:1.1em;
}
.button:hover{
background-color:#f9f9f9;
border-color:#999999;
color: #212121;
}
.button:active{
background-color:#71B800;
border-color:#64A300;
color: #ffffff;
}
JavaScript
setTimeout(function() {
$('#debug').html('Pausing so you can see the difference');
alert('jQuery UI is going to do its thing now, watch closely!');
$('#debug').html('Invoking jQuery UI now!');
$('.apply-ui-after-delay').removeClass('button').button();
$('#debug').html('jQuery UI has been applied to this page')
}, 4000);