BuddyDev

Search

Dequeue bp-nouveau css

  • Participant
    Level: Yogi
    Posts: 1117
    calu on #47978

    Hi Brajesh, I read an old topic about dequeue bp-nouveau css, where you gave the code below.

    When I add the code, some changes appear, but I’m not quit sure what dequeue and enqueue actually actually do, and it this is the solution I’m looking for.

    I want to be able to make changes in buddypress.css but any changes to either the core buddypress.css or in the copy to the child theme do not apply.

    I have created this path in my child theme: generatepress_child > buddypress > css > buddypress.css

    I contacted my theme support who wrote:
    “If you want to totally change a stylesheet of a plugin, you need to dequeue it first. Then, you can enqueue your own version of the stylesheet. You just need to find the handle of the stylesheet for BuddyPress to dequeue it properly. It would be best to reach out to BuddyPress regarding this.”

    
    /**
     * Dequeue BP Nouveau style
     */
    function buddydev_dequeue_nouveau_styles() {
    	wp_dequeue_style( 'bp-nouveau' );
    }
    
    add_action( 'wp_enqueue_scripts', 'buddydev_dequeue_nouveau_styles', 11 );

    https://buddypress.org/support/topic/dequeue-bp-nouveau-css/

    Regards
    Carsten

  • Participant
    Level: Yogi
    Posts: 1117
    calu on #47979

    It looks like the code is bypassing buddypress.css file. It is only some css changes to menu tabs I want to change, so what should I do from here, copy the contents from buddypress.css into a new file?

    Thanks

  • Keymaster
    (BuddyDev Team)
    Posts: 24653
    Brajesh Singh on #47988

    Hi Carsten,
    Welcome back!

    Thank you for the question.
    Before I assist, let me help you with a few points:-

    WordPress has a convention for loading asset files(css/js)

    1. Enqueing:- You tell WrodPress to load some asset file identified a name(handle) and a url.
    2. Dequeuing:- You tell WordPress to disable loading of a previously enqueued asset fle.

    When a page load, WordPress looks for all the enqueued asset which needs loading and loads them in the page(head or footer depending on enqueue params).

    The handle is unique and allows you to manage dependency, loading order etc.

    Now, do you want to completely remove the BO Nouveau style?
    Please let me know and I will assist.

    Regards
    Brajesh

  • Participant
    Level: Yogi
    Posts: 1117
    calu on #47989

    Hi Brajesh, thank you 😉

    I’ve read a post at buddypress.org that I could simply copy buddypress.css to my child theme and edit it from there. But that turns out not to be as easy as that.

    No I do not want to completely remove Nouveau style, just to be able to edit in buddypress.css style sheet where all the code and selectors are already there, so I just have to changes values and colors, instead of using the inspector for inspecting and then adding changes to my custom css.

    Regards
    Carsten

  • Keymaster
    (BuddyDev Team)
    Posts: 24653
    Brajesh Singh on #47991

    Hi Carsten,
    BuddyPress is loading buddypress.min.css, so please create a file and name it buddypress.min.css and put it in your theme/buddypress/css directory.

    BuddyPress will pick it instead of the default nouveau css.

    Hope it works.

    Regards
    Brajesh

  • Participant
    Level: Yogi
    Posts: 1117
    calu on #47992

    Hi Brajesh, thanks for your help, I’m looking forward to test this.

    Do I still need the Dequeue BP Nouveau style code, or should this be deleted?

    Regards
    Carsten

  • Keymaster
    (BuddyDev Team)
    Posts: 24653
    Brajesh Singh on #47994

    You are welcome.
    No, Please don’t do that. Otherwise, this file will not be loaded automatically.

    Regards
    Brajesh

  • Participant
    Level: Yogi
    Posts: 1117
    calu on #47996

    Hi Brajesh, just to clear out any misunderstandings.

    You did mean that I should delete the Dequeue BP Nouveau code?

    Othervise it does not work for me.

    I have renamed the copy of buddypress.css to buddypress.min.css in my child theme, and apperently this is working.

    If I keep the code in my bp-custom.php, the buddypress.min.css is not loaded

    Regards
    Carsten

    
    /**
     * Dequeue BP Nouveau style
     */
    function buddydev_dequeue_nouveau_styles() {
    	wp_dequeue_style( 'bp-nouveau' );
    }
    
    add_action( 'wp_enqueue_scripts', 'buddydev_dequeue_nouveau_styles', 11 );
    
    
  • Participant
    Level: Yogi
    Posts: 1117
    calu on #47998

    Hi Brajesh, I’m a bit confused wether or not to use buddypress.min.css or the Dequeue/Enqueue function.

    I read this at https://buddypress.org/support/topic/modifying-buddypress-min-css/

    “Now if you want to change any buddypress styles create a folder in child theme top level ‘buddypress/ in that a folder named /css/ so we have ‘buddypress/css/ in that css folder copy buddypress.css; now you have a full copy of the bp styles and BP will automagically find that file and use it instead of it’s original copy, you can now edit anything you care to in that file.”

    Can you clarify on this eventually provide some documentation on what is right and what is wrong, since there is a lot of confusion and different opinions on this topic?

    Regards
    Carsten

  • Keymaster
    (BuddyDev Team)
    Posts: 24653
    Brajesh Singh on #48003

    Hi Carsten,
    unless you have “SCRIPT_DEBUG” enabled, BuddyPress will not load buddypress.css. It only loads it in dev mode. In production mode, it loads the buddypress.min.css

    Regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: not resolved