Skip to content

Adjusting the size of boxes in posts-list class

Solved Customisation
  • Hi @phenomlab ,

    In NodeBB, there are many pages containing a list of posts such as bookmarks, upvoted, etc.

    For example:
    https://sudonix.com/user/crazycells/upvoted

    How can I change the height of the boxes containing the post with CSS? I would like to increase the box size, so a bigger part of the post will show as a preview in those lists…

    All those lists contain “posts-list” class…

  • @crazycells It’s not so much the height of the boxes that causes the issue here, but more the CSS class overflow: hidden;. You could change that to the below

    .posts-list .posts-list-item .content {
        overflow: auto;
    }
    

    This would then give you something like this

    9d3f213c-f4b7-4795-b7de-99689fd07ed4-image.png

    Notice the scrollbar that appears meaning you scan keep the same panel height, but still scroll through the message to be able to read all of it.

    If you wanted the panel height to size with the content, you’d need to do this

    .posts-list .posts-list-item .content {
        max-height: none;
        height: auto;
    }
    

    Which in turn would result in this

    569b9c79-eadc-4eb2-ae3b-d612b401f010-image.png

    I’d personally take the overflow: auto; route as this is easier on the eyes. However, you get a balance of the two by setting a higher value for max-height , so

    .posts-list .posts-list-item .content {
        max-height: 600px;
    }
    

    This would still require overflow: auto;, but by setting max-height you are able to increase the height of the panel to something more aligned with your requirements, and still be able to read the entire message without having to open it.

    c3ad820c-0cc3-4fee-b099-4cc3466959ce-image.png

    The block of HTML being targeted here is below

    1358ca2c-4d07-4314-bf0c-8ccd1b322941-image.png

  • @phenomlab thanks a lot, this combination works best 👍

    .posts-list .posts-list-item .content {
        overflow: auto;
        max-height: 600px;
    }
    
  • crazycellsundefined crazycells has marked this topic as solved on

Did this solution help you?
Did you find the suggested solution useful? Why not buy me a coffee? It's a nice gesture, and a great way to show your appreciation 💗

Related Topics
  • TNG + Nodebb

    General
    4
    0 Votes
    4 Posts
    142 Views

    @Madchatthew said in TNG + Nodebb:

    you have to try and use duck tape and super glue to change something to make it do what you want it to do

    I couldn’t have put that better myself.

  • MogoDB v6 to v7 upgrade

    Solved Configure
    5
    1 Votes
    5 Posts
    505 Views

    @Panda if you used the Ubuntu PPA, I think this only goes as far as 6.x if I recall correctly.

  • nodebb error logs

    Bugs
    6
    4 Votes
    6 Posts
    394 Views

    I just wanted to ask because I don’t have much knowledge about the new installation.
    Thank you for the explanatory answer.

  • Composer options on nodebb

    Solved Configure
    8
    3 Votes
    8 Posts
    430 Views

    @Panda You should be able to expose the CSS for these using F12 to get into console

    3591518c-e3a3-4ada-a43c-6b32a5e0359c-image.png

    a2b8ed46-4157-4ff2-85f0-576543380107-image.png

    That should then expose the element once selected

    89d9c545-a47a-40d1-98f4-80cf3b958e8f-image.png

    Here’s the below CSS you need based on the screenshot provided.

    .composer .formatting-bar .formatting-group li[data-format="picture-o"], .composer .formatting-bar .formatting-group li[data-format="spoiler"] { display: none; }
  • NodeBB: Favicon upload issue

    Solved Configure
    12
    3 Votes
    12 Posts
    538 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!

  • chat list navbar

    Solved Customisation
    30
    3 Votes
    30 Posts
    2k Views

    No no it’s ok @phenomlab
    I just comment the 2 lines mentionned aboves 😉

  • creating topic specific widgets

    Solved Customisation
    16
    10 Votes
    16 Posts
    1k Views

    @crazycells said in creating topic specific widgets:

    Additionally if hide class exists, why are we re-defining it?

    We’re not 🤭 I misspelled it - it should be hidden

  • [NodeBB] First post customization

    Solved Customisation
    5
    4 Votes
    5 Posts
    724 Views

    @phenomlab thanks 🙏