Sublime Forum

How to edit adaptive theme

#1

I like the black title bar of the new adaptive theme.
However the adaptive theme doesn’t appear in either the Packages nor Application (macOS) directories.
How can I adjust this theme? I want to change the search bar input from white to black.
Alternatively - is there a new config to adjust the title bar colour in my old theme?

Thanks!

0 Likes

#2

The same way like you would do with a color scheme.

Extract it using PackageResourceViewer and start hacking.

1 Like

#3

Is there any disadvantage to leaving it extracted?

0 Likes

#4
  1. By zipping it back to the Theme - Default package, you’ll loose your changes after the next upgrade. I wouldn’t do that.
  2. The extracted just overrides the default theme. This is no harm, but you might need to check for changes of the default file after the next update. Therefore, I’d suggest to leave only the modified content in that extracted theme file. All *.sublime-theme files with the same name are merged by ST. Means you can write a “patch” with your desired changes. I did so with the font.face as I like Roboto Mono rather than default font. You don’t need to care about updates then.
1 Like

#5

You can actually adjust it by just creating a file Adaptive.sublime-theme in your User folder: Menu > Preferences > Browse Packages....

For example, the following will removing the left padding in the side bar and align the folders with the tree structure:

User/Adaptive.sublime-theme

[
    {
        "class": "sidebar_tree",
        "indent_offset": 0,
        "indent": 12
    }
]

ref: https://github.com/gerardroche/sublimefiles/blob/608e97a576b94374247bb6c9f98fe44fa306c60e/User/Adaptive.sublime-theme

As far as I know, you can pretty much override anything in the Adaptive theme or any theme. As @deathaxe points out, they are merged, and your User directory is merged last so it anything defined there will override everything else.

3 Likes

#6

Perfect, thank you.

0 Likes

#7

Very helpfull. (I was looking how change the color of the search bar over an hour).
This code is working

{
    "class": "quick_panel_label",
    "fg": [200, 200, 200, 255],
    "match_fg": [0, 255, 0, 255],
    "selected_fg": [255, 255, 255, 255],
    "selected_match_fg": [0, 255, 0, 255]
}

But i have one question, how can i know what name has other settings (for example color of folder in left sidebar?)

Is there some list of all “class” or “name” or “keys” which describes all UI elemenst, which i can change? (I really mean list of all elements).

THX

1 Like

#8

http://www.sublimetext.com/docs/3/themes.html#elements

1 Like

#9

Oh My mistake, thx.

Last one: Where is described how should I name the file and where should I place the file with the selected theme?

0 Likes

#10

You use same file name as the one you want to override and you put in your User folder. Locate it by going to Menu > Preferences > Browse Packages. Inside that directoru there is User folder.

So for example, the Adaptive theme file name is Adaptive.sublime-theme. So to override it create a file of the same name in your User directory: Packages/User/Adaptive.sublime-theme.

When you set configuration to use Adaptive.sublime-theme ST looks for all files named Adaptive.sublime-theme and merges them together. It will merge the one found in your User directory last so whatever you define in that theme file will override everything else.

0 Likes

#11

thanks for a comprehensive explanation, i understand but but where can I find it in the documentation?
(For a similar kind of questions, I do not want to ask in future)

Is there exists a default “Adaptive.sublime-theme” file?. I would like to see the complete configuration of what can i set up.

Im using standalone version and there is nothing like that. Thx!

0 Likes

#12

The official documentation covers this (you want the section Themes at the bottom of the page): https://www.sublimetext.com/docs/3/

There is, but it’s in one of the packages that ship with Sublime, so it’s not visible in your Packages folder.

You can open the Sublime console with Ctrl+` or View > Show Console and then enter this command:

window.run_command("open_file", {"file": "${packages}/Theme - Default/adaptive/Adaptive.sublime-theme"})

That will open a read only copy of the file for you to refer to.

1 Like

#13

OdatNurd

ou can open the Sublime console with Ctrl+` or View > Show Console and then enter this command:

window.run_command(“open_file”, {“file”: “${packages}/Theme - Default/adaptive/Adaptive.sublime-theme”})
That will open a read only copy of the file for you to refer to.

Fantastic, that’s exactly what I’m looking for, THX!

0 Likes