Skip to content

Code block hard to read with light theme

Solved Configure
9 2 628 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? 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 nodebb
    6
    2 Votes
    6 Posts
    225 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
    1k 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
    806 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
    629 Views
    @phenomlab Perfect!!! Many thanks.
  • MogoDB v6 to v7 upgrade

    Solved Configure nodebb
    5
    1 Votes
    5 Posts
    644 Views
    @Panda if you used the Ubuntu PPA, I think this only goes as far as 6.x if I recall correctly.
  • How to deploy WordPress.org Developer theme

    Solved Configure wordpress theme github
    4
    1 Votes
    4 Posts
    522 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 replica set

    Configure mongodb docker ansible
    11
    2 Votes
    11 Posts
    757 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?
  • Cannot read property 'config' of undefined

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