On Fri, Feb 20, 2009 at 10:07 AM, Aaron Pfeifer <[email protected]>wrote:
>
> One of the things I've been thinking about with regard to the new CSS
> framework in JQuery UI is whether there are plans to allow the css
> classes to be configurable. Prior to soon-to-be 1.7 css classes used
> to be configurable via the options hash passed into each widget. For
> example,
>
> $('#tabs').tabs({loadingClass: 'ui-tabs-spinning'});
>
> It would appear that this capability is being phased (or completed
> removed) from jQuery UI.
Yes.
> If this is the case, I'm wondering if that
> are plans in the future to allow for these CSS classes to be
> configured on a widget-wide basis.
Nope. This is the design of the jQuery UI CSS Framework. It's now part of
the jQuery UI API if you will.
>
> I'm not suggesting this is the right solution, but that there is some
> common way for widgets to "register" css classes and allow those to be
> overridden by the developer.
At some level we have to tie the JavaScript to the css, so these classnames
are our standard interface. If these were configurable by the developer,
theming would completely break down (just to give one example).
There are two types of classes added to each jQuery UI Plugin
*Plugin-specific classes*
(examples):
.ui-dialog
.ui-dialog-titlebar
.ui-dialog-content
.ui-dialog-buttonpane
...
*CSS Framework classes*
(examples):
.ui-widget
.ui-widget-header
.ui-widget-content
.ui-state-hover
...
For a full example of classes added to the dialog elements, see
http://docs.jquery.com/UI/Dialog#theming
> Currently, I've written a plugin which hooks into $.className.add,
> $.className.remove, etc. in order to unobtrusively force widgets to
> use my custom CSS class names. I could, of course, modify the widget
> implementations directly, but I want to avoid that as much as
> possible.
>
> Any thoughts on this?
If that works for you, sounds like a reasonable approach.
- Richard
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---