Skip to:
Content

BuddyPress.org

Changeset 4436


Ignore:
Timestamp:
05/28/2011 11:43:37 PM (15 years ago)
Author:
djpaul
Message:

Move buddybar CSS out of BP-Default.
Maintain backpat for any child theme customisations. Add minified versions.

Location:
trunk
Files:
3 added
2 edited
2 copied
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-buddybar.php

    r4409 r4436  
    471471 * Handle the Admin Bar/BuddyBar business
    472472 *
     473 * @global num $wp_version
    473474 * @todo Clean up global constants
    474  *
    475  * @global num $wp_version
    476475 */
    477476function bp_core_load_admin_bar() {
     
    492491
    493492                // Admin bar styles
    494                 $stylesheet = get_blog_option( BP_ROOT_BLOG, 'stylesheet' );
    495 
    496                 if ( file_exists( WP_CONTENT_DIR . '/themes/' . $stylesheet . '/_inc/css/adminbar.css' ) )
    497                         wp_enqueue_style( 'bp-admin-bar', apply_filters( 'bp_core_admin_bar_css', WP_CONTENT_URL . '/themes/' . $stylesheet . '/_inc/css/adminbar.css' ), array(), BP_VERSION );
    498                 else
    499                         wp_enqueue_style( 'bp-admin-bar', apply_filters( 'bp_core_admin_bar_css', BP_PLUGIN_URL . '/bp-themes/bp-default/_inc/css/adminbar.css' ), array(), BP_VERSION );
     493                if ( file_exists( get_stylesheet_directory() . '/_inc/css/adminbar.css' ) ) // Backwards compatibility
     494                        $stylesheet = get_stylesheet_directory_uri() . '/_inc/css/adminbar.css';
     495                elseif ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG )
     496                        $stylesheet = BP_PLUGIN_URL . '/bp-core/css/buddybar.dev.css';
     497                else
     498                        $stylesheet = BP_PLUGIN_URL . '/bp-core/css/buddybar.css';
     499
     500                wp_enqueue_style( 'bp-admin-bar', apply_filters( 'bp_core_admin_bar_css', $stylesheet ), array(), BP_VERSION );
    500501
    501502                // Actions used to build the BP admin bar
     
    512513}
    513514
     515/**
     516 * Load the buddybar's RTL stylesheet if appropriate.
     517 *
     518 * This can't be done in bp_core_load_admin_bar() because that function is called before locale.php is included.
     519 *
     520 * @since 1.3
     521 */
     522function bp_core_load_buddybar_rtl_stylesheet() {
     523        if ( !is_rtl() )
     524                return;
     525
     526        if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG )
     527                $stylesheet = BP_PLUGIN_URL . '/bp-core/css/buddybar-rtl.dev.css';
     528        else
     529                $stylesheet = BP_PLUGIN_URL . '/bp-core/css/buddybar-rtl.css';
     530
     531        wp_enqueue_style( 'bp-admin-bar-rtl', apply_filters( 'bp_core_buddybar_rtl_css', $stylesheet ), array( 'bp-admin-bar' ), BP_VERSION );
     532}
     533add_action( 'wp', 'bp_core_load_buddybar_rtl_stylesheet' );
    514534?>
  • trunk/bp-themes/bp-default/rtl.css

    r4430 r4436  
    667667/* > Footer
    668668-------------------------------------------------------------- */
     669
    669670#footer-widget-area div.widget-area > ul {
    670671        float: right;
     
    676677        margin-left: 0;
    677678}
    678 
    679 
    680 /* > Admin bar styles
    681 -------------------------------------------------------------- */
    682 
    683 #wp-admin-bar {
    684         right: 0;
    685         left: auto;
    686 }
    687 #wp-admin-bar div#admin-bar-logo {
    688         right: 10px;
    689         left: auto;
    690 }
    691 #wp-admin-bar li {
    692         text-align: right;
    693 }
    694 #wp-admin-bar li.no-arrow a {
    695         padding-left: 15px;
    696         padding-right: 0;
    697 }
    698 #admin-bar-logo {
    699         float: right;
    700 }
    701 
    702 #wp-admin-bar ul li {/* all list items */
    703         float: right;
    704         background: url( _inc/images/admin-menu-arrow.gif ) 12% 53% no-repeat;
    705         padding-left: 11px;
    706         padding-right: 0;
    707 }
    708 #wp-admin-bar ul li.no-arrow {
    709         padding-left: 0;
    710 }
    711 #wp-admin-bar ul li.align-right {
    712         left: 0;
    713         right: auto;
    714 }
    715 
    716 /* second-level lists */
    717 #wp-admin-bar ul li ul {
    718         right: -999em;
    719         left: auto;
    720         margin-right: 0;
    721 }
    722 #wp-admin-bar ul li ul li {
    723         float: right;
    724 }
    725 
    726 /* third-and-above-level lists */
    727 #wp-admin-bar ul li ul ul {
    728         margin: -25px 184px 0 0;
    729 }
    730 #wp-admin-bar ul li:hover ul,
    731 #wp-admin-bar ul li li:hover ul,
    732 #wp-admin-bar ul li.sfhover ul,
    733 #wp-admin-bar ul li ul li.sfhover ul {/* lists nested under hovered list items */
    734         right: auto;
    735 }
    736 #wp-admin-bar ul li.align-right:hover ul {
    737         left: 0;
    738         right: auto;
    739 }
    740 #wp-admin-bar ul li:hover ul ul,
    741 #wp-admin-bar li.sfhover ul li ul {
    742         right: -999em;
    743         left: auto;
    744 }
    745 
    746 /* Menu item css */
    747 #wp-admin-bar img.avatar {
    748         float: right;
    749         margin-left: 8px;
    750         margin-right: 0;
    751 }
    752 #wp-admin-bar span.activity {
    753         margin-right: 34px;
    754         margin-left: 0;
    755 }
    756 #wp-admin-bar ul li#bp-adminbar-notifications-menu a span {
    757         margin-right: 2px;
    758         margin-left: 0;
    759 }
Note: See TracChangeset for help on using the changeset viewer.