Skip to content

Changing the look of recent cards

Announcements
  • I wanted a way to draw attention to the recent cards on the categories page to make them stand out more - and what better way to do this than with some CSS. Here’s a short video of the outcome of that very exercise. Watch the recent cards closely as I cycle through the themes.

    There’s a gradient being set there which is essentially two of the core colours in each theme.

    For example, in swatch “Anthracite”, it’s easy to see how this effect works

    1981b09d-671d-42c7-89ae-555f30916669-image.png

    Essentially, we are setting the border-color and color variables to match the color set by the category itself. Essentially, this is an extension of this thread
    https://sudonix.com/topic/256/recent-cards-plugin-customization

    The minor change here is just one line

    $(document).ready(function() {
        $(window).on('action:ajaxify.end', function(data) {
            $('.recent-card-container').each(function(i) {
                var dataId = $(this).attr("data-cid");
                var color = $('[role="presentation"]', this).css("background-color");
                //console.log("data-cid " + dataId + " is " + color);
                $('[data-cid="' + dataId + '"] .recent-card').attr("style", "border-color: " + color);
                $('[data-cid="' + dataId + '"] .recent-card h4 a').attr("style", "color: " + color);
            });
        });
    });
    

    The line in question is

    $('[data-cid="' + dataId + '"] .recent-card h4 a').attr("style", "color: " + color);
    

    By adding this line, we change both the border color, and the text color to match. I also chose to thicken the border by 1px to give it a bit more depth, which works very well. I did consider a box-shadow but I think that may look somewhat “overdone” and odd when coupled with other elements. The jury is still out on that one 🙂


  • 3 Votes
    4 Posts
    134 Views

    @crazycells said in CSS code customization for the link preview plugin:

    does OGProxy show the pdf previews as well?

    Not yet, but it could with a bit of additional code.

  • 6 Votes
    15 Posts
    705 Views

    No no, I said that in the sense that he told me it was simple ^^
    I was able to see that this was not the case by targeting the elements he had advised me.

  • Quote design CSS

    Solved Customisation
    15
    4 Votes
    15 Posts
    684 Views

    @DownPW yes, that does make sense actually. I forgot to mention the layout of Sudonix is custom so that would have an impact on the positioning.

    Good spot 🙂

  • New message CSS problem

    Unsolved Customisation
    11
    2 Votes
    11 Posts
    549 Views

    @DownPW hi. Sorry for digging up an old post, but I’m going through items still unresolved and was looking to get an understanding of where you are currently with this?

  • Fontawesome 5

    Unsolved Customisation
    14
    1 Votes
    14 Posts
    680 Views

    @pwsincd hi. Just following up on this thread (I know it’s old) but was curious to understand if it’s still an issue or not ?

  • 3 Votes
    2 Posts
    555 Views

    @pwsincd welcome to sudonix, and thanks for the comments. What your looking for is here

    https://sudonix.com/topic/195/nodebb-welcome-message/3?_=1648295651358

  • Avatar on Topic Header

    Solved Customisation
    9
    0 Votes
    9 Posts
    526 Views

    @jac said in Avatar on Topic Header:

    @downpw said in Avatar on Topic Header:

    Great Plugin 🙂

    I make it a bit cleaner via this CSS code:

    /*------------------------------------------------------------------*/ /*---------------- nodebb-plugin-browsing-users -----------------*/ /*------------------------------------------------------------------*/ /*Space between the avatar and the RSS icon */ .topic [component="topic/browsing-users"] { margin-bottom: -5px; padding-left: 10px; } /*Space between avatars*/ .pull-left { float: left!important; padding-right: 5px; }

    Do you have a screenshot of how this looks with the CSS change?

    Just added this change, thanks @DownPW 🙂

  • Theme changes

    Announcements
    6
    10 Votes
    6 Posts
    460 Views

    There’s still some very minor bugs in the two themes (light and dark) but these will be resolved in the coming days. Some are specific to firefox, and well require special attention, but will still be resolved nonetheless.