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 🙂


Related Topics
  • Ch..ch..ch..ch..changes!

    Announcements
    16
    15 Votes
    16 Posts
    221 Views

    @phenomlab of course, to be recognised is fantastic.

    @phenomlab said in Ch..ch..ch..ch..changes!:

    Sadly, no. Web crawlers and scrapers are often JS based and read text only, so styles don’t have any bearing.

    I’ve read mixed things about this, but no that does make sense, it was something I read a many years back when using Wordpress.

  • ANNOUNCEMENT: Social Login Changes

    Announcements
    4
    6 Votes
    4 Posts
    465 Views

    @DownPW Always looking for ways to improve the overall experience.

  • navigation menu panel on mobile

    Solved Customisation
    8
    7 Votes
    8 Posts
    457 Views

    @crazycells hmm. That’s odd. I haven’t made any changes from recollection but I could be wrong. I’ll need to check.

    EDIT - very strange. I honestly don’t recall adding the below CSS block to alter the bottom bar, but you’re right…

    .bottombar-nav { padding: 0px !important; }

    I’ve removed this so it reflects stock Harmony.

  • Fixing YouTube videos css

    Solved WordPress
    8
    2 Votes
    8 Posts
    522 Views

    @phenomlab It looks good, but not anymore. I’ve already lost so much time. Now it’s time to move on

  • Avatar on Topic Header

    Solved Customisation
    9
    0 Votes
    9 Posts
    672 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 🙂

  • [NODEBB] CSS Style Sheets SelectBox

    Locked Solved Customisation
    112
    24 Votes
    112 Posts
    14k Views

    @DownPW as discussed in PM

    Seems to have been solved with the new JS code that you added allowing the version CSS file change!!

    Cache problem therefore with the JS of the Switcher theme

    Based on this, I will close this thread and reference
    https://sudonix.com/topic/207/nodebb-help-for-my-custom-css/27

  • Theme changes

    Announcements
    6
    10 Votes
    6 Posts
    551 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.

  • Discourse Design Change

    Customisation
    25
    7 Votes
    25 Posts
    2k Views

    @phenomlab okay