I am working heavily in jQuery UI widgets and theming is becoming hard because of an oversight that I need to work around.
Consider this problem:
<div id="node" class="ui-widget">
<div class="ui-widget-content">
</div>
</div>
Then this jQuery code:
<script>
$(function() {
$('#node').hover(function (){
$(this).toggleClass("ui-state-error");
});
});
</script>
I would like the ui-state-error to be !important to the nested div. This is pseudocode, but I find large examples of this happening where containers have CSS swaps and children (basically) ignore it.
What is even worse is this: if I would like to be able to overwrite in jQuery, say, "backgroundcolor=ui-state-error:background-color knowing 100% it all won't go to pieces, because I don't "know" necessarily that that background is the important one for the element in question.
Here is a fiddle of a case in point: http://jsfiddle.net/WCuYH/1/