How to define theme in CONFIG?

Hello there,

I’m completely new to Silverbullet. I’m toying around with the CONFIG page of the v2 and I see in the doc here that there is some kind of theming. But then three questions arise:

  1. When I set theme = "dark" and then reload/reload UI nothing happens
  2. When I use the comman palette to set dark theme of Silverbullet I don’t see any change in the CONFIG so where is this stored actually ? Where can I define this ?
  3. How can I define/get more themes ?

Thanks in advance and really sorry if this is a silly question.

In hindsight, I took you on a bit of an unnecessary journey. It’s been a very long day, so I apologize. More concisely:

  1. Create a file anywhere, but somewhere sensible. I created mine at System/Style/default; maybe you might choose User/CSS/. The important part is the next bullet.
  2. Paste your CSS within a space-style block. If you need the relevant CSS, let me know
  3. Make edits
  4. Reload your UI
  5. Your theme changes should be reflected

My original comment addresses this, but hides it behind another, related journey I went on to modularize my CSS to allow easy base16 theming. I included that because I discovered where to put the CSS when I was trying to implement base16 theming.

Original:

I created a System/Style/default file, within which I placed a space-style code block containing the following:

'''space-style
html {

  --base00: #f7f9fb;
  --base01: #e5ebf1;
  --base02: #cbd6e2;
  --base03: #aabcce;
  --base04: #627e99;
  --base05: #405c79;
  --base06: #223b54;
  --base07: #0b1c2c;
  --base08: #bf8b56;
  --base09: #bfbf56;
  --base0A: #8bbf56;
  --base0B: #56bf8b;
  --base0C: #568bbf;
  --base0D: #8b56bf;
  --base0E: #bf568b;
  --base0F: #bf5656;
  
  --ui-accent-color: var(--base0D);
  /* etc. */
}
'''

(those single quotes are standing in place of backticks)

This allows me to define a base16 color scheme and automatically update the theme by assigning --baseNN values to all of the CSS properties, including the dark and light mode ones.

I think the relevant part of my answer is to create a space-style block in a page somewhere sensible (the important part is the space-style, not the file location), paste in the relevant CSS, do a system and widget reload (alt-shift-r), and off you go. I just included the base16 stuff because it solved another adjacent issue for me in a very easy way. It’s a lot of work to set up the CSS to use the right color variables, but once it’s done it’s done.

Do you have the complete CSS file for SB to begin editing? It’s a large file and mine is only about 60% adapted to the base16 theme format.

If you’re looking for dark mode, you can toggle between light and dark with the command 'Editor: Toggle Dark Mode '.

Thanks, I’m away at the moment but will try this as soon as I come back.

I don’t have what you call the CSS file for SB.

Do you mean that theming is a rather tedious task regarding the size of the CSS ? As I saw a few themes in the idea category I thought this wouldn’t be a daunting task. But if it is I’ll just stick with it’s default looks for now

Thanks . I indeed saw this option, I was just trying to understand this CONFIG entry and don’t understand why setting theme to darks does not work. But maybe this was just an example out of the documentation that has no real implementation?

Then where does this setting gets stored? Because I thought CONFIG was reflecting that.

I don’t think it’s daunting, particularly. There isn’t a lot of advanced CSS going on. It’s just a relatively sizeable stylesheet. That’s why I did the base16 setup: so I could just change values in one location and have them propagate through the entire stylesheet. Tell you what: let me get motivated to finish base16-ing mine, and I’ll send you the stylesheet via DM, if such a thing exists here.

And if you find it easy to use, I’ll post it somewhere more public. Are you comfortable with hex values and/or rgba(x, y, z, a) values or is that all gibberish to you?

Sure, I don’t have any particular issue with hex or rgb values you can go on :slight_smile:

Well if you can find some motivation I won’t say no to this proposal! :grin: