Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > General Articles
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
HOW TO Find what Stylevar you need to edit
Dunhamzzz
Join Date: Jul 2008
Posts: 54

 

Hampshire, UK
Show Printable Version Email this Page Subscription
Dunhamzzz Dunhamzzz is offline 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:
Right now navigate to the a page that has something you want to change on, open firebug and click inspect as circled here:



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:



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):

Code:
.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:


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.



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 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
Attached Images
File Type: jpg firebughowto.jpg (151.5 KB, 0 views)
File Type: jpg firebughowto2.jpg (166.6 KB, 0 views)
File Type: jpg firebughowto3.jpg (154.3 KB, 0 views)
File Type: jpg firebughowto4.jpg (139.5 KB, 0 views)
Reply With Quote
  #2  
Old 12-16-2009, 06:38 PM
Trip's Avatar
Trip Trip is offline
 
Join Date: Mar 2008
Location: Eastern Canada
Posts: 199
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:
Reply With Quote
  #3  
Old 12-24-2009, 06:28 PM
tafreeh tafreeh is offline
 
Join Date: May 2008
Location: Canada
Posts: 536
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks for that.. but i guess Google Chrome has this default
Reply With Quote
  #4  
Old 12-28-2009, 02:09 PM
fourat fourat is offline
 
Join Date: Mar 2008
Posts: 174
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks for that
Reply With Quote
  #5  
Old 12-28-2009, 08:31 PM
chloe101 chloe101 is offline
 
Join Date: Dec 2007
Posts: 116
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OMG Dunhamzzz!! I LOVE YOU! Thanks for saving me sleepless nights!
Reply With Quote
  #6  
Old 12-29-2009, 10:06 AM
Brother Malachi Brother Malachi is offline
 
Join Date: Jun 2008
Posts: 208
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The stylevar dictionary is also very helpful:
http://www.vbulletin.com/forum/entry...F-Documents%29
Reply With Quote
  #7  
Old 01-04-2010, 03:06 PM
chriske chriske is offline
 
Join Date: Oct 2008
Posts: 167
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks, Should have used this earlier!
Reply With Quote
  #8  
Old 01-04-2010, 09:19 PM
Cableguy69 Cableguy69 is offline
 
Join Date: Apr 2008
Posts: 150
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for this will make my life easier.
Reply With Quote
  #9  
Old 01-05-2010, 03:51 PM
Dunhamzzz Dunhamzzz is offline
 
Join Date: Jul 2008
Location: Hampshire, UK
Posts: 54
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by tafreeh View Post
thanks for that.. but i guess Google Chrome has this default
Same, I oly use FF on my development desktop.
Reply With Quote
  #10  
Old 01-08-2010, 02:48 PM
abdobasha2004's Avatar
abdobasha2004 abdobasha2004 is offline
 
Join Date: Aug 2008
Posts: 541
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

for me I just search for the nearest template tag : < -- tag -->
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:01 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05074 seconds
  • Memory Usage 2,318KB
  • Queries Executed 24 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (2)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (4)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete