PDA

View Full Version : HOW TO Find what Stylevar you need to edit


Dunhamzzz
12-15-2009, 10:00 PM
Loads of people are having problems finding which stylevar they need for a certain element. Here's an easy way to get you started in the world of css.

You will need:


To be using Firefox (http://www.getfirefox.com)
and to install the Firebug addon
(http://getfirebug.com/)
Make sure you restart Firefox if asked to.

Right now navigate to the a page that has something you want to change on, open firebug and click inspect as circled here:

https://vborg.vbsupport.ru/external/2009/12/80.jpg (https://vborg.vbsupport.ru/attachment.php?attachmentid=107596&stc=1&d=1260964987)

Then, using your mouse, hover over the part of your site you want to edit, and all the CSS values attributed to it will appear in the bottom right hand corner:

https://vborg.vbsupport.ru/external/2009/12/81.jpg (https://vborg.vbsupport.ru/attachment.php?attachmentid=107597&stc=1&d=1260964987)

The underline is the classes/ids that are affecting said element, from these you can derive the name of the style var. In the example we can see the class is ".navtabs li a.navtab:hover", which gives us a clue we're looking for some sort of "tab" variable. We have to use common sense and look in the "navbar" section of the stylevar manager, and we can see there a few variables called "navbar_tab".

If you still can't find the stylevar you need, you can also copy the id from the firebug panel - .navtabs li a.navtab:hover - and go to Search in Templates. That will bring up the css template where it is defined - vbulletin-chrome.css in this case. Click on the template to Edit and then click on Find (the words you searched for will already be entered in the Search box). You will then see exactly what stylevars define that class (in case it isn't obvious):

.navtabs li a.navtab:hover {
background:{vb:stylevar navbar_tab_selected_background} 0 -{vb:stylevar navbar_tab_selected_top_width}px;
_background-image:none;
/*color:{vb:stylevar linkhover_color};*/
color:{vb:stylevar navbar_tab_linkhover_color};
}

We can see the var that we need to edit (navbar_tab_selected_background) here:
https://vborg.vbsupport.ru/external/2009/12/82.jpg (https://vborg.vbsupport.ru/attachment.php?attachmentid=107598&stc=1&d=1260964987)

In this example (below) we can see the CSS name for this bit of the forum is called ".threadbit .alt", so look in the threadbit section in the stylevars and voila! You should see alternating colour in there.

https://vborg.vbsupport.ru/external/2009/12/83.jpg (https://vborg.vbsupport.ru/attachment.php?attachmentid=107599&stc=1&d=1260964987)

This obviously won't plainly point out the variables all the time, but it's a step in the right direction. You can also check you're editing the right variable by checking if the values you see in firebug reflect the variables in the admincp.

Handy Hints:


You can open Firebug with F12!
You can also right-click and select "inspect element" to get right in the action!
You can click on the CSS values and change them on-the-fly to get a preview!
You can edit the HTML as well!
There are ways (http://getfirebug.com/lite.html) to get Firebug on IE, if you really, really must.!

*Edit- Would have looked better with the images displayed inline as in the Preview :(
Cheers to Lynne for noting that you can search for the CSS classes/ids in Search In Templates

Trip
12-16-2009, 06:38 PM
I was aware of the firebug add-on, but never experimented with it and wasn't aware of what it can actually do. Thanks for the write-up, it'll come in handy :):up:

tafreeh
12-24-2009, 06:28 PM
thanks for that.. but i guess Google Chrome has this default :)

fourat
12-28-2009, 02:09 PM
thanks for that

chloe101
12-28-2009, 08:31 PM
OMG Dunhamzzz!! I LOVE YOU! Thanks for saving me sleepless nights!

Brother Malachi
12-29-2009, 10:06 AM
The stylevar dictionary is also very helpful:
http://www.vbulletin.com/forum/entry.php?2398-StyleVar-Visual-Dictionary-for-Forum-Blog-and-CMS-%28PDF-Documents%29

chriske
01-04-2010, 03:06 PM
Thanks, Should have used this earlier!

Cableguy69
01-04-2010, 09:19 PM
Thanks for this will make my life easier.

Dunhamzzz
01-05-2010, 03:51 PM
thanks for that.. but i guess Google Chrome has this default :)

Same, I oly use FF on my development desktop.

abdobasha2004
01-08-2010, 02:48 PM
for me I just search for the nearest template tag : < -- tag -->

Attitude5ire
01-16-2010, 11:54 AM
You can also use Web Developer Extension, its lighter than firebug. I prefer that.

Lynne
01-16-2010, 03:00 PM
You can also use Web Developer Extension, its lighter than firebug. I prefer that.
Or have both, like I do. I use different parts from each one depending on what I'm trying to do.

carrlos
01-23-2010, 05:39 PM
This really helped me but it's ridiculous that I have to resort to all this to make some simple color changes.

Mukashi
01-27-2010, 03:18 PM
Agreed. For people like myself who basically only had 4 color setups (not including text and links), it's ridiculous that we now need at least an hour to create a basic style, with the first style just learning the stylevars taking significantly longer than that.

I posted a request for a mod or script that would convert the colour scheme from a vB3 style into the vB4 stylevars, that's been put into the requests for paid services by a mod, but I've not even had a nibble as yet.

Mecca860
01-30-2010, 02:23 AM
Very great topic...fixed a couple of things that where off in my forum...thank you very much

daveaite
01-31-2010, 06:14 PM
Try using http://stylevars.com

felixxx999
02-02-2010, 10:04 PM
https://vborg.vbsupport.ru/showthread.php?t=233446

I've tried to use the guide but I'm stumped on a few colors. Any help would be appreciated. I'm really surprised that mods like this wouldn't be clearer. Anyway, thanks. http://www.backalleynoir.com

zeroality
02-14-2010, 08:04 AM
Just wanted to mention that Chrome has this built in.

iamacyborg
02-19-2010, 11:48 AM
You've also got a built in tool for this in Opera. It's the developer console, which you can find by clicking Tools -> Advanced -> Developer Tools.

encryption
02-24-2010, 11:09 PM
Thank you, this has been a constant headache!

skrabler
04-03-2010, 09:26 PM
thanks for that.. but i guess Google Chrome has this default :)

Chrome has several css identification extensions that will help (https://chrome.google.com/extensions/search?itemlang=&q=css).

Fuhrmann
05-18-2010, 03:53 PM
Great this! I already tried to make something like that on Chrome...but now i will try on firefox.

salafmisr.net
07-21-2010, 08:43 AM
very useful topic , thanks

delmarva
08-19-2010, 05:59 AM
Try using http://stylevars.com

Thanks so much for this!

garycb
04-02-2011, 06:39 PM
IE 9 has the option for Developer tools which appears to have the same functionality as Firebug has with Firefox. I have worked with it at length just a off the cuff comment.:)

too_cool_3
01-21-2012, 05:22 PM
This thread just saved me an unimaginable ammount of time trying to skin my forum. I don't know how I even did it without firebug before. (very slowly lol).

This thread should be stickied here and over at vb.com !