Skip to content

Code block hard to read with light theme

Solved Configure
  • 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? Why not buy me a coffee? It's a nice gesture, and a great way to show your appreciation 💗

Related Topics
  • Spam spam spam

    Solved Configure
    6
    2 Votes
    6 Posts
    113 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.
  • Opening links in nodebb widget

    Solved Configure
    6
    4 Votes
    6 Posts
    606 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
    14
    11 Votes
    14 Posts
    372 Views
    @phenomlab Perfect!!! Many thanks.
  • Pulling YouTube videos using RSS

    Configure
    5
    7
    6 Votes
    5 Posts
    221 Views
    The perfect solution and walkthrough Mark, appreciated as always!
  • Getting Eror When Started NodeBB

    Solved Configure
    7
    1
    2 Votes
    7 Posts
    565 Views
    @phenomlab yes i did. i deleted one of plugin then it started to work normally.
  • mongodb replica set

    Configure
    11
    2 Votes
    11 Posts
    586 Views
    @veronikya said in mongodb replica set: The host’s local dns resolution is not configured. The problem of the host’s hosts being unable to be resolved in docker has been solved. Surprisingly Solution: Edit the /etc/resovel.conf file Add 127.0.0.53 One immediate issue I can think of here is that editing resolv.conf directly is no longer supported and not recommended (because the changes do not survive a reboot) - unless you install the resolvconf package?
  • Adding fileWrite to nodebb code

    Solved Configure
    16
    1
    5 Votes
    16 Posts
    918 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.
  • Cannot read property 'config' of undefined

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