Skip to content

Code block hard to read with light theme

Solved Configure
9 2 2.2k 1
  • We were discussing skin colors yesterday, and on that topic …
    the text in code boxes is hard to read here.
    Does it appear same to you?
    Screenshot_20230801_130806_Chrome~2.jpg

  • @Panda I see why - if you check the browser console, there’s an error logged there. This is from one of my VM’s

    image.png

    There is a decision tree that pulls the value of the editor theme from the saved browser settings on each load, but that fails if the theme has never been changed, and the user has the default (in your case, you are using light mode, so it serves “flatly” by default, but the editor itself is never set and returns null

    This below code changes that

    /* If savedTheme is undefined it will return null - based on this, we assume that the user has the default theme selected and never
    changed it, so we'll need to force that here
    */
    if(!savedTheme) {
    var savedTheme = "flatly";
    }
    

    If you reload your browser and test again, it should work properly.

  • We were discussing skin colors yesterday, and on that topic …
    the text in code boxes is hard to read here.
    Does it appear same to you?
    Screenshot_20230801_130806_Chrome~2.jpg

    @Panda I’ve moved this post to it’s own topic as it has no relevance to the thread it was originally in. I’d recommend you clear your cache as I am not able to replicate this issue here.

  • phenomlabundefined phenomlab has marked this topic as solved on
  • @Panda I’ve moved this post to it’s own topic as it has no relevance to the thread it was originally in. I’d recommend you clear your cache as I am not able to replicate this issue here.

    @phenomlab ok, in your browser is the text darker / more readable?
    If thats how its supposed to look no problem. Maybe its just my old eyes!

    It appears the same on all my devices, & incognito, which I guess picks up the default settings

  • @phenomlab ok, in your browser is the text darker / more readable?
    If thats how its supposed to look no problem. Maybe its just my old eyes!

    It appears the same on all my devices, & incognito, which I guess picks up the default settings

    @Panda said in Code block hard to read with light theme:

    ok, in your browser is the text darker / more readable?

    yes - see below

    7d0bcf8f-61a2-4cc5-8815-d619d8a550b2-image.png

  • @Panda said in Code block hard to read with light theme:

    ok, in your browser is the text darker / more readable?

    yes - see below

    7d0bcf8f-61a2-4cc5-8815-d619d8a550b2-image.png

    @phenomlab ok! I can read that fine.

    A mystery then, I just texted it on firefox too (which I never accessed sudonix from before) all 3 are the same very feint.

  • @phenomlab ok! I can read that fine.

    A mystery then, I just texted it on firefox too (which I never accessed sudonix from before) all 3 are the same very feint.

    @Panda Let me check - does it do the same if you use a dark theme?

  • @Panda Let me check - does it do the same if you use a dark theme?

    @phenomlab its very readable on dark theme.

    But Im mentioning it as the sites default settings should be readable, as new users wont know to change theme etc, and most people will stick with default.

  • @phenomlab its very readable on dark theme.

    But Im mentioning it as the sites default settings should be readable, as new users wont know to change theme etc, and most people will stick with default.

    @Panda You’ve found a bug ! Thanks for this - I know why it fails, and will fix it in a minute. Will need you to re-try…

  • @Panda I see why - if you check the browser console, there’s an error logged there. This is from one of my VM’s

    image.png

    There is a decision tree that pulls the value of the editor theme from the saved browser settings on each load, but that fails if the theme has never been changed, and the user has the default (in your case, you are using light mode, so it serves “flatly” by default, but the editor itself is never set and returns null

    This below code changes that

    /* If savedTheme is undefined it will return null - based on this, we assume that the user has the default theme selected and never
    changed it, so we'll need to force that here
    */
    if(!savedTheme) {
    var savedTheme = "flatly";
    }
    

    If you reload your browser and test again, it should work properly.

  • phenomlabundefined phenomlab has marked this topic as solved on

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
  • Nodebb to Xenforo

    Solved Configure xenforo nodebb
    3
    0 Votes
    3 Posts
    666 Views
    @cagatay as @downpw stated, there isn’t a native tool that will do this for you. You’d need to either develop your own or ask the nodebb team to assist which will be a paid exercise.
  • Spam spam spam

    Solved Configure nodebb
    6
    2 Votes
    6 Posts
    2k Views
    @Panda said in Spam spam spam: ok, yes Ive seen the queue, it shows IP, but doesnt have a field for comments from registrant. It’s not designed for that. It merely serves as a gateway between posts appearing on your form or not. @Panda said in Spam spam spam: It would be better if nodebb had this plugin included in ACP list, as not only then do you know its approved and should work, but many people cant or dont want to use CLI on the server That’s a question for the NodeBB devs but in all honesty you can’t not use the CLI when installing nodebb so to be this isn’t a big deal.
  • Nodebb and emails

    Solved Configure nodebb
    27
    5 Votes
    27 Posts
    7k Views
    @Panda it will use SMTP. In all cases, I never use any plugin to send email. I’ll always send it raw.
  • Opening links in nodebb widget

    Solved Configure nodebb
    6
    4 Votes
    6 Posts
    2k Views
    A more efficient way of including this would be to not over complicate it and leverage a standard iframe (providing the CSP headers of the remote site permit this) like below <iframe src="https://www.classmarker.com/online-test/start/?quiz=gag66aea7922f0a5" width="700" height="800"></iframe> This works first time every time on your site as intended.
  • Test of youtube embeds

    Solved Configure nodebb
    14
    11 Votes
    14 Posts
    3k Views
    @phenomlab Perfect!!! Many thanks.
  • Pulling YouTube videos using RSS

    Configure rss youtube rsshub
    5
    7
    6 Votes
    5 Posts
    2k Views
    The perfect solution and walkthrough Mark, appreciated as always!
  • MogoDB v6 to v7 upgrade

    Solved Configure nodebb
    5
    1 Votes
    5 Posts
    2k Views
    @Panda if you used the Ubuntu PPA, I think this only goes as far as 6.x if I recall correctly.
  • Adding fileWrite to nodebb code

    Solved Configure nodebb
    16
    1
    5 Votes
    16 Posts
    4k Views
    @eveh this might be a question for the NodeBB Devs themselves. In all honesty, I’m not entirely sure without having to research this myself.