Skip to content

[NODEBB] Help for my custom CSS

Solved Customisation
237 5 79.9k 3
  • I’d like to do the same thing with the website logo.

    For example, at Christmas time, I’d like to change my logo to something like a Santa hat, but it’s always cut off.

    I’ve tried adjusting the size and margins, and even modifying the logo’s pixels directly, but it doesn’t seem to work. It’s always cut off in the same way.

  • I’d like to do the same thing with the website logo.

    For example, at Christmas time, I’d like to change my logo to something like a Santa hat, but it’s always cut off.

    I’ve tried adjusting the size and margins, and even modifying the logo’s pixels directly, but it doesn’t seem to work. It’s always cut off in the same way.

    said in [NODEBB] Help for my custom CSS:

    I’d like to do the same thing with the website logo.

    For example, at Christmas time, I’d like to change my logo to something like a Santa hat, but it’s always cut off.

    I’ve tried adjusting the size and margins, and even modifying the logo’s pixels directly, but it doesn’t seem to work. It’s always cut off in the same way.

    @phenomlab ?

  • This post is deleted!
  • I just upgraded to the latest version to see if I could replicate this, which I can’t. Do you perhaps have overriding CSS?

  • resolve with :

    li[component=post] a[href*=“/groups/administrators”] {
    position: absolute !important;
    left: 2px;
    z-index: 2;
    margin-top: 1px;
    border-radius: 999px !important;
    line-height: 14px;
    display: block;
    margin-left: 6px !important;
    background: var(–bs-user-level-bg) !important;
    color: var(–bs-body-color-primary) !important;
    width: auto;
    }

  • resolve with :

    li[component=post] a[href*=“/groups/administrators”] {
    position: absolute !important;
    left: 2px;
    z-index: 2;
    margin-top: 1px;
    border-radius: 999px !important;
    line-height: 14px;
    display: block;
    margin-left: 6px !important;
    background: var(–bs-user-level-bg) !important;
    color: var(–bs-body-color-primary) !important;
    width: auto;
    }

    @DownPW great, but use position: absolute; carefully and sparingly

  • Hi,

    I’d like to enlarge the div so that the logo is fully displayed. Right now, for example, it’s cut off on the right at the glasses.

    8d7fea95-a138-42be-9ffd-12448b0b6fcd-image.jpeg

    an idea ?

  • if I set :

    • {
      overflow: visible !important;
      }
      it’s OK.

    I have not overflow: hidden in my custom css on acp…

    Maybe because Fancybox add an <a> no ?

    9780086b-1ca2-4b61-bf56-b4eb9e1c8871-image.jpeg

  • if I set :

    • {
      overflow: visible !important;
      }
      it’s OK.

    I have not overflow: hidden in my custom css on acp…

    Maybe because Fancybox add an <a> no ?

    9780086b-1ca2-4b61-bf56-b4eb9e1c8871-image.jpeg

    @DownPW strange. Fancybox doesn’t actually alter the image as far as I recall.

    Does it make a difference if you change the class name (in developer mode) from fancybox to say, fancybox1?

    If it works, then the class may have that defined already.

  • @baris said:

    You should change your selectors so it doesn’t look at the entire document. You probably only want to apply fancybox to stuff inside the #content element which is what changes when the user navigates around the page. So use $('#content a').... for your selectors then the forum logo in the header won’t be selected.

    I modified the JS Fancybox code now and this code and it seem better 🙂

    // ---------------------------------------------
    // Fancybox Media Reader (Without Website Logo)
    // ---------------------------------------------
    
    if (top.location.pathname !== '/login') {
        $(window).on('action:posts.loaded', function(data) {
            console.log("Polling DOM for lazyLoaded images to apply Fancybox");
            $(document).ready(function() {
                $('#content a').not('.forum-logo').not(".avatar").not(".emoji").not(".bmac-noanimate").each(function() {
                    $('#content a[href*=".jpg"], #content a[href*=".jpeg"], #content a[href*=".png"], #content a[href*=".gif"], #content a[href*=".webp"]').addClass("noanimate");
                });
            });
        });
    }
    
    if (top.location.pathname !== '/login') {
        $(document).ready(function() {
            $(window).on('action:ajaxify.end', function(data) {
                $('#content a').not('.logo').not(".avatar").not(".emoji").not(".bmac-noanimate").each(function() {
                    $('#content a[href*=".jpg"], #content a[href*=".jpeg"], #content a[href*=".png"], #content a[href*=".gif"], #content a[href*=".webp"]').addClass("noanimate");
                    data.preventDefault()
                    // Strip out the images contained inside blockquotes as this looks nasty :)
                    $('#content blockquote img').remove();
                });
                Fancybox.bind(
                    '#content a[href*=".jpg"], #content a[href*=".jpeg"], #content a[href*=".png"], #content a[href*=".gif"], #content a[href*=".webp"]',
                    {
                        groupAll: true,
                    }
                );
            });
        });
    }
    
    // Chat fancybox - fires when chat module loaded and AJAX calls new chat
    $(document).ready(function() {
        $(window).on('action:chat.loaded', function(data) {
            // >>> Se limiter au contenu principal uniquement <<<
            $('#content img').not('.forum-logo').not(".avatar").not(".emoji").not(".bmac-noanimate").each(function() {
                var newHref = $(this).attr("src");
                $(this).wrap("<a class='fancybox' href='" + newHref + "'/>");
                $('#content a[href*=".jpg"], #content a[href*=".jpeg"], #content a[href*=".png"], #content a[href*=".gif"], #content a[href*=".webp"]').addClass("noanimate");
                data.preventDefault();
                // Strip out the images contained inside blockquotes as this looks nasty :)
                $('#content blockquote img').remove();
            });
            Fancybox.bind(
                '#content a[href*=".jpg"], #content a[href*=".jpeg"], #content a[href*=".png"], #content a[href*=".gif"], #content a[href*=".webp"]',
                {
                    groupAll: true,
                }
            );
        });
    });
    

    For the logo, I must use overflow: visible !important; on [component="brand/logo"]

    /* --- Logo --- */
    [component="brand/logo"] {
      max-height: 50px;
      width: auto;
      height: auto;
      max-width: 100%;     
      display: block;
      object-fit: contain;  
      object-position: left center;
      overflow: visible !important;
    }
    

    Better result !!


Did this solution help you?
Did you find the suggested solution useful? Support 💗 Sudonix with a coffee
If your organisation needs deeper expertise around infrastructure, security, or technology leadership, learn more about Phenomlab Ltd. Many of the deeper technical guides behind Sudonix are published there.

Related Topics
  • Please help me, I can't install nodebb

    Locked Solved Customisation nodebb
    7
    5 Votes
    7 Posts
    919 Views
    Installation completed, verified, and tested. Correct installation methodology is below https://docs.nodebb.org/installing/os/ubuntu/
  • nodebb-plugin-custom-pages

    Solved Customisation plugin custom-pages
    5
    2
    3 Votes
    5 Posts
    3k Views
    @DownPW it’s possible, yes, but you may inadvertently end up targeting other elements using the same class which of course isn’t desired. Can you provide a link in DM for me to review?
  • Header Menu After Upgrading V3.1.1

    Solved Customisation header nodebb
    2
    1
    2 Votes
    2 Posts
    659 Views
    @cagatay this relates to a change the css classes used for the brand header meaning it will now float to the left instead of right. If you’d like to retain the original behavior, you can add this css class [data-widget-area="brand-header"] { justify-content: end; display: flex; } Further information here https://community.nodebb.org/topic/17090/manual-build-a-custom-header-in-harmony/19?_=1684069325296
  • NodeBB: Favicon upload issue

    Solved Configure nodebb favicon
    12
    1
    3 Votes
    12 Posts
    2k Views
    @phenomlab I am on a Mac, so I used the “Option + Command + I”, and then performed the steps. It loaded my favicon! I checked on Firefox which I haven’t used before, and it showed my favicon also! That’s fantastic and thank you for the help!
  • Custom badges

    Solved Customisation nodebb
    103
    2
    49 Votes
    103 Posts
    26k Views
    Perfect
  • Changing the look of recent cards

    Announcements cards css
    1
    1
    2 Votes
    1 Posts
    631 Views
    No one has replied
  • NodeBB metadata

    Solved Configure nodebb
    4
    2 Votes
    4 Posts
    1k Views
    @phenomlab said in NodeBB metadata: @jac Are you sure ? https://www.google.co.uk/search?q=site%3Astockportcounty.fans&sxsrf=AOaemvLwnaZL-PliU_2dBOg_Eo1pMVhBjg%3A1638982328139&source=hp&ei=uOKwYeatBcOsad3yp7AE&iflsig=ALs-wAMAAAAAYbDwyLBSDcG5XYoFCKwQFhgz94wTxOcV&ved=0ahUKEwjm6dX71NT0AhVDVhoKHV35CUYQ4dUDCAk&uact=5&oq=site%3Astockportcounty.fans&gs_lcp=Cgdnd3Mtd2l6EAM6BAgjECc6CwgAEIAEELEDEIMBOg4ILhCABBCxAxDHARCjAjoRCC4QgAQQsQMQgwEQxwEQowI6BQguEIAEOggIABCABBCxAzoFCAAQgAQ6CAguELEDEIMBOgsILhCABBDHARCvAToICC4QgAQQsQM6BQgAELEDOgsILhCABBDHARDRAzoLCAAQgAQQsQMQyQM6BQgAEJIDUABYySZg0CdoAHAAeACAAW2IAa0NkgEEMjMuMpgBAKABAQ&sclient=gws-wiz Fair enough 🤪🤪.
  • NodeBB customisation

    Locked Customisation
    332
    27 Votes
    332 Posts
    134k Views
    @jac Given your departure away from your previous project, I’m going to close this thread…