views:

240

answers:

3

Hi, I've recently been messing around with jquery(ui) and now I want to add some jquery bits to my personal website. Well, the themes produced by Theme Roller are really awesome, and I'd like my entire website to look like that, not just the few jquery enabled parts. So, is it wrong to use css classes as listed at http://jqueryui.com/docs/Theming/API for your own things that don't actually use any javascript? Like doing a <div class="ui-widget">

Is there some easier/cleaner way to do this that I'm not seeing? Is this a normal approach or is it overkill?

+2  A: 

It's not wrong to do so, but it may confuse people if you use the styles haphazardly

jQueryUI is currently in development; the latest beta has a new function that creates buttons for you, so as you can see, all of the styles will eventually have a defined purpose and scripted way to create elements

davidosomething
+1  A: 

The answer is no it is not wrong. Overall you're on the right track. Use JQuery's classes they are there for a reason! However do not alter them. If you need to enhance looks, add in your own custom classes or IDs, that way you won't make a mess of the default css and break the Jquery Plug ins. Refer to the links below for more information.

Keep in mind if you do plan to use JQuery UI as a foundation, you'll need to worry about backwards compatibility issues should JQuery change/update their own CSS Files, this is another reason why any custom styling you do should be done using your own classes in support of JQuery's.

http://docs.jquery.com/UI/Theming/API - Refer to this web page to know where and how to apply JQuery's default classes

http://www.filamentgroup.com/lab/developer_your_own_jquery_themeroller_ready_components/ - This is slightly outdated but contains useful information on how to pair custom classes with JQuery

http://www.filamentgroup.com/lab/styling_buttons_and_toolbars_with_the_jquery_ui_css_framework/ - This article gets more into buttons, note it is more up to date than the prior one but both are valuable for conceptualizing your idea.

CogitoErgoSum
A: 

No its not wrong to do at all. In fact, it would be considered leveraging code to achieve a nice finished product.

A the recent jQuery Conference in Boston, we got to see a demo by the Filament Group (the people who built the theme roller) and they say they use the themed elements for their entire backend sites. Then, they use a bookmarklet when they are meeting with the client to change the entire theme on the fly. Just by changing the theme, the entire website shifts style and colors.

Just remember, the dot isn't supposed to be there when you use the class in HTML:

<div class="ui-widget">
Doug Neiner