With my question I suspect a lot of people may get confused between dynamic styling (what you can achieve by jQuery's .css() function and dynamic CSS rules. The first is where it only changes the styles of existing elements matching the selector. But what I am after is adjusting the rule so any new elements matching the selector will also use that (dynamic) rule.
As an example let's take a set of DIVs with class "pane".
I can change the background color of existing panes using $(".pane").css({"background-color": "#00f"});
But if I then add a new pane $("body").append("<div class='pane'></div>");
it won't use this new style because it isn't a rule.
I don't understand why adding/changing CSS rules isn't the default behaviour? Was this ever discussed by a W3C working group to anyone's knowledge?
Does anyone know if it is possible to add or change CSS rules dynamically client side (ie without communicating with the server)?