2

Can I use my own css and override all the default jquery css? Also is there any link between the jquery css and the jquery ui?

3
  • 1
    you can use the online site to customize the jquery ui theme, that will be much easier than to rebuilt it from scratch jqueryui.com/themeroller Commented Mar 12, 2012 at 15:58
  • Without CSS jsfiddle.net/Ajinkya_Parakh/R7Ghk/1/embedded/result With juery CSS jsfiddle.net/Ajinkya_Parakh/R7Ghk/2/embedded/result. I think its look good with juery CSS and anyway you can overwrite all CSS (I dont know why you will do it) Commented Mar 12, 2012 at 16:05
  • @max4ever I tried using themeroller but found that it's more kinda generic i.e i wasnt able to change the border of modal dialog box alone whereas the css i've made includes all that. And i found the default jquery naming conventions a bit confusing. It might be coz they have simplified it too much to bring the size down. Commented Mar 12, 2012 at 18:05

5 Answers 5

7

First, to clarify, there is no CSS associated with the jQuery library.

For jQuery UI however there are themes, which has CSS-files associated. Those files can easily be overwritten by your own CSS-files, if you desire to do so. Just make sure that your CSS-rules have higher specificity than the rules provided by the theme CSS.

You can also get rid of the theme CSS-files altogether and run nothing but your own CSS-files, as the CSS-files do not affect the functionality of jQuery UI. For simplicity I would however choose a theme that is as close to what you want to achieve as possible, and then override the parts of that theme that is necessary to make it look the way you want. That way you don't have to write the entire theme your self, but can make use of the work of others.

Sign up to request clarification or add additional context in comments.

Comments

1

Well, if you want the look of jQuery UI you need to use that CSS file, but there are no Functional" needs for the CSS files, in fact jsfiddle.net when loads jQuery ui doesn't load the CSS file

4 Comments

jQuery doesn't have a standard 'look';
@Nicola: I think jsFiddle.net will also load CSS if we ask him to do so jsfiddle.net/Ajinkya_Parakh/R7Ghk/2/embedded/result
@Ajinkya yes but everything works fine even if you don't load the css.
@Nicola: Yes completely agree. I will just make it look good.
0

You don't need the jQuery UI CSS file, it just makes the UI elements look like UI elements; they'd look odd without it. You can make your own CSS if you want. The jQuery UI Theme Roller can help with this.

Comments

0

jQuery UI contain the style information of different parts of the UI section
Like jQuery Dialogue,jQuery Date Picker etc
If you dont use the CSS then there is not effect in the functionality
But remember its not a good idea to exclude the css file
The best opition is include the css file and then modify it according to your need.

Comments

0

It's all just HTML and CSS at the end of the day.

The jQuery UI javascript just creates the HTML elements and will add all the class names to the elements. If you don't reference a jQuery UI css file then there will be very default styles ( e.g. inline widths/heights/fonts etc...) applied to the UI.

So you can create your own CSS file to change the UI, or roll your own theme as others have suggested.

1 Comment

so does that mean that jquery ui js file does not have any relation with the css file? I was thinking that it may use the css for changing the classes of the various components upon various actions like hover, click etc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.