Border Frame WYSIWYG CSS

Solved Customisation

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💗

  • 1 Votes
    1 Posts
    42 Views

    I thought I had already created a dedicated thread for this elsewhere, but clearly not - it was probably bundled in with another topic.

    If you want to create an “Author” badge on each post that looks like the below, you can do this using pure CSS

    d983d994-c4b6-4063-ae1e-74bba88d75b5-image.png

    Required CSS

    .topic-owner-post [itemprop=name]:after { border: 2px solid var(--bs-border-color); border-radius: 0.25rem !important; color: var(--bs-body-color); content: "Author"; margin-left: 5px; padding: 2px 10px; display: inline-block; }

    However, things get slightly more complicated if you want to add an icon in the same element, like the below

    a81318a0-a15c-45f1-94f7-ee17a1931433-image.png

    As the above example makes use of the :after pseudo element, it’s not possible to have two font-family statements when using content: ""

    To facilitate this, you’d need a jQuery function that looks like the below

    $(document).ready(function() { $(window).on('action:ajaxify.end', function(data) { $(".topic-owner-post [itemprop=name]").append("<span class='author'><span class='author-icon'><i class='fa-light fa-bullhorn'></i>Author</span>"); }); });

    Here, you use span tags to insert both the icon, and text 🙂

    Obviously, you need to ensure that the css for .author and .author-icon exist.

    Here’s an example

    span.author { border: 2px solid var(--bs-border-color); border-radius: 0.25rem !important; color: var(--bs-body-color); content: "Author"; margin-left: 5px; padding: 2px 10px; display: inline-block; } span.author-icon i { margin-right: 5px; }
  • 1 Votes
    2 Posts
    137 Views

    @Sala This should look better

    .sidenav .navbar-brand { padding-top: 0.5rem; padding-bottom: 0.5rem; }

    e5cec20e-be36-4ee8-9129-fd11ad4656ac-image.png

    You can increase the top and bottom padding by increasing the values above.

  • New message CSS problem

    Unsolved Customisation
    11
    2 Votes
    11 Posts
    309 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?

  • 2 Votes
    1 Posts
    121 Views

    One simple feature I wanted in Sudonix was for the border of the first post in a new thread to match the colour set by the category. This makes the first post stand out, and looks nice too 🙂

    The code is based around the same functionality here

    https://sudonix.com/topic/256/recent-cards-plugin-customization

    It’s relatively simple in it’s approach. Here is is

    $(document).ready(function() { $(window).on('action:ajaxify.end', function(data) { var categoryColor = $('[role="presentation"].icon').css("background-color"); $('li.topic-owner-post:nth-child(1)').css('border-color', categoryColor); }); });

    Essentially, this jQuery snippet looks for the role="presentation" attribute in the topic stream (there’s only the one, so no need for any loop to detect all of them like we do in the previous link), grab the CSS value, and then set it as the border so it looks like this

    53ed0377-97d3-4d3b-b445-cb0f46bdd52f-image.png

    All you need to do is copy the snippet, and place this in your ACP -> Appearance -> Custom JS

    Enjoy…

  • 4 Votes
    8 Posts
    2k Views
  • 38 Votes
    193 Posts
    5k Views

    OMG make sense

    Thanks dude 🙂

  • 24 Votes
    112 Posts
    3k 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

  • CSS Help on my Flarum

    Solved Customisation
    5
    2 Votes
    5 Posts
    283 Views

    @mike-jones Yes, you’ll typically see this type of behaviour if there is another style that has higher priority in the sense that yours will be overridden. Using !important will override the higher preference, but should be used sparingly rather than everywhere.