Theme CSS isn't showing for logged out users

Hey there,

I’ve created a new component which adds extra css styles to my theme. I’ve applied the component to all themes including the default theme.

I’ve noticed when you’re logged out, it doesn’t show all the CSS but when you’re logged in it does? I’m sure there’s some setting somewhere i’m missing or something i’m not understanding. I’ve looked around for a while and can’t seem to figure out why this is happening, any help would be much appreciated!

Hello there :slight_smile:

Can you share with us the CSS you added? Did you add javascript to your forum?

Hey! I have the following CSS:

.custom-homepage-columns .header-wrapper a h2, a:visited, .user-menu.revamped .tabs-list .btn .badge-notification, a, { color: #ffffff; }

a:hover { color: #35af74; }

@import url(https://fonts.googleapis.com/css?family=Baloo+2);

body { font-family: 'Baloo 2', 'Helvetica', cursive; font-size: 18px; }

I haven’t added anything javascript to the forum unless the components I added have. I have the following components:

  • Category Banners
  • Dark-Light Toggle
  • Discourse Clickable Topics
  • Discourse Loading Slider
  • Modern Category + Group Boxes
  • Nav Link Component
  • Tag Styles
  • Tiles - Gallery Component
  • Versatile Banner

The CSS which isn’t showing however is actually via the theme colors and not related to the above, under Customize → Colors → Theme, i’ve changed the primar/secondary/tertiary colours but they’re only getting applied when logged in.

I’d say it’s probably because the theme you edited isn’t the default one.
You can check this here:

I think i’m homing in on the problem, even though the theme is set to solarized dark as default, as you can see from the dropdown it’s saying “Light” is the default, so I’m guessing logged out users are seeing that. Just trying to find where to change that. Solarized dark should be taking priority. Not entirely sure what this “Light” theme is either, looks like a discourse default?

1 Like

Yes, it is :slight_smile:

1 Like

I think I see the issue, when I check solarized as the default theme, then save/refresh, it unchecks it as the default. Not sure why this is happening, bug with the theme?

I think I figured out the issue, it’s a silly one…when I was checking the box to confirm enabled, I wasn’t hitting the tick button to save it because it was invisible due to my css. Only until after assuming/clicking the invisible tick button it saved.

It’s likely i’ve set the tick button to the same colour as the background so I didnt see it and assumed checking the box automatically saves it :clown_face:

At the moment it still shows the default theme in incognito mode but i’ll give it some time in case it’s cached.

Try choose Theme can be selected by users too. I know, default should be selectable automatic.

Thanks, I gave that a go. Unfortunately it’s still showing different colours in guest mode even after figuring out I didn’t hit confirm for making Solarized the default theme. Does discourse have any kind of hard caching that needs flushing?

Reload of the tab is enough. If you are using DiscourseHub you have to close and open your session.

1 Like

Starting to wonder if this is a bug with the theme or the way it’s set up by the author. So there’s two color palettes for Solarized Dark as you can see here:

The lowercase named palette is “not editable, owned by: solarized”. Unfortunately this palette takes priority in guest/incognito/logged out mode. The theme you directly edit is the capitalised colour palette above but that one only shows up after logged in.

Unless the author makes the original colours editable, I don’t think there’s much I can do here without hardcoding the css. Hope this makes sense, its’ tricky to explain without seeing it.

Edit: Hardcoding it overrode the un-editable theme color options in guest mode. I’ll just accept that as the solution for now.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.