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.
  • 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!
  • How to deploy WordPress.org Developer theme

    Solved Configure wordpress theme github
    4
    1 Votes
    4 Posts
    2k Views
    @Hari the real issue here is that I don’t think it can be used as a theme for WordPress because of the dependencies it clearly has, including its own Web server. My view here is that this is designed to be a complete development environment outside of the WordPress core.
  • mongodb backup problem

    Moved Configure mongodb
    3
    1
    1 Votes
    3 Posts
    1k Views
    You might want to also review this post https://sudonix.org/topic/389/mongodb-backup-script
  • Email Server Settings

    Solved Configure mx entry
    25
    10 Votes
    25 Posts
    8k Views
    @Onix said in Email Server Settings: If anyone has long-term experience with self-hosted SMTP + DNS set-ups that remain stable, would be great to hear which configurations worked best. I can help with this
  • Cannot read property 'config' of undefined

    Solved Configure
    1
    0 Votes
    1 Posts
    816 Views
    No one has replied