Sublime Forum

ST4: Variable names in JS files now the same colour as the background

#1

Similar to a lot of people, yesterday I updated my Sublime installation after being prompted, and got version 4. I spent most of the day working in PHP, so didn’t notice this until today, but: all of my variable names in JS are now the exact same colour as the background:

If I select the block, you can (just) make out the variable names.

I have the One Dark Theme/Color Scheme installed, and if I switch to a different color scheme (e.g. Monokai) they come back… but I kinda love the One Dark theme and want to stick with it.

I’m guessing this is a similar issue to this thread, but I have no clue about editing themes for ST or where to look to tweak this (and having looked at the theme file, it is pretty big).

Does anyone have any ideas?

1 Like

#2

I know this is an old support request, but as a fellow user of this theme I finally got sick enough of this problem to bother fixing it.

Thankfully the fix is trivial:

  1. Choose Customize Color Scheme from the Sublime Text Preferences menu
  2. Click anywhere on the left side of the split (One Dark.tmTheme)
  3. Open the Command Palette (e.g. Cmd+Shift+P) and choose Plugin Development: Convert Color Scheme to .sublime-color-scheme from the list
  4. Save the resulting theme. It should default to your User packages folder.

Thankfully you don’t need to change the theme definition itself at all.

2 Likes

#3

This was an issue that drove me insane for months. Hopefully it will help someone else.
What worked for me:

  1. Choose Customize Color Scheme from the Sublime Text Preferences menu
  2. Click anywhere on the left side of the split ( One Dark.tmTheme )
  3. Search for <string>subl_new js vars</string> Should be line 777.
  4. Prepend a ‘#’ to the start of <string>adb7c9</string> to make it like this
    <string>#adb7c9</string>
  5. Save. Alternatively, change the color to whatever you wish.

It seems like the author missed out on the hashtag causing the variable color to take the default background color.

1 Like

#4

4 years later, I still have this problem.

thank you @throwaway and @kitgrose for the insight I can do a QUICK FIX:

  1. Choose Customize Color Scheme
  2. On the One Dark.sublime-color-scheme (the RIGHT panel) add the following:
{
"rules":
	[
		{
            "name": "subl_new js vars",
            "scope": "source.js                          variable.other.readwrite.js",
            "foreground": "hsl(219, 21%, 73%)",
        },
	]
}

Save.
My problem fixed.
Your problem fixed.

0 Likes

#5

Surprise, surprise, Theme - One Dark is still archived since 2020 (5 years at the time of writing) which indicates no more changes to be expected by that unmaintained outdated package.

Maybe try maintained Theme - One instead?

Note you’ll need to uninstall the old package before up-to-date One Dark color scheme takes effect.

0 Likes

#6

well honestly Im using portable version of ST4 which I forget when did the last time I updated it. :rofl::rofl::rofl::rofl:
just 2 weeks ago or so, it got forced to update the old One Dark.
then just recently I noticed this problem.
I already on the theme tho, but the problem arise.
May be overlapped config from the outdated one?
IDKit just resolved

0 Likes

#7

Yes, both ship a One Dark color scheme and package loading order causes the older one to take precedence. Maybe we should just forward the outdated package to the new one to avoid future confusion.

1 Like