tags:

views:

1079

answers:

2

I see on the YUI page an example about changing the style for panels in general. But I'd like to change the style for all the tooltips (and not other panels) on my website. All my tooltips are not in one certain DIV, so changing the YUI panel styles within a div won't work for me.

Any tips?

+1  A: 

It looks like YUI Tooltips add the class yui-tt to all tooltips. You could style just your tooltips by using that as a common ancestor, i.e.

.yui-tt .bd {
    /* Styles here... */
}
Daniel Lew
I had to add "!important" after my styles in my stylesheet, I guess because I'm using the YUI loader and it loads the styles for the tooltip after my own stylesheet has been loaded. But it works, thanks!
Sean
+1  A: 

I load the configurator's style sheet (with the default skin (sam.css) already included) in the head of my app followed by my own styles, so they are ready for immediate rendering. However as you mentioned, the YUI loader will subsequently override your styles.

If you load a lot of modules or make a lot of style declarations and don't want to write !important after every one, add the option

skin : {defaultSkin: ''}

to your loader configuration. This will also save a little bit of bandwidth for your users and lead to faster rendering.

Also note, that IE6 doesn't recognize !important so it won't work for that browser.

Hope that helps.

Keith Bentrup
That's real important to know... thank you!
Sean
I just noticed that even when I set the default skin to '', YUI still makes a connection to try and download stylesheets for everything, looking for a skin called "undefined". This seems a little wasteful, all those unnecessary connections. You know if there's any way to disable this?
Sean
I haven't found a way around it, but since at this point in your web app, everything else should be loaded, those 404 connections shouldn't really hold anything else up and immediately return
Keith Bentrup