How to change Sublime Text 2 selected tab color

半腔热情 提交于 2019-11-29 21:21:11

You need to dig pretty deep into theme customization to do that:

Since your theme is Monokai (medium-dark) go to "Packages/Theme - Default/Default.sublime-theme"

From lines 528 to 531 are your answers...

Either you hack by changing tint_modifier or layer2.opacity

OR

You go right at "medium_dark_unselected_tab_bg2.png" and try changing it by "light_unselected_tab_bg2.png" for example.

Either way I recommend you using Soda Theme! A really great and easily configurable theme too!

Ravi Ram

This is the best solution I have found: https://coderwall.com/p/jg4kog

  1. Inside of Sublime Text go to Preferences > Browse packages

  2. Navigate to the User folder.

  3. There you create a file called Default.sublime-theme

  4. Open that file in Sublime Text and copy and paste the following JSON object:

.

[
   {"class": "tab_control", "attributes": ["selected", "file_medium_dark"],"tint_modifier":[255, 255, 255, 80]}
]

For my Monokai theme I did:

vim ~/.config/sublime-text-2/Packages/Theme\ -\ Default/Default.sublime-theme +609

This brings you to line 609, then change:

"fg": [55, 255, 55, 230]

Now fg color will be green.

Teenage

To change Selected tab title color, edit :

Packages/Theme - Default/Default.sublime-theme (as said Romain)

Then search for the comment Tab Labels and change the fg attributes of the classes that contain selected from 255, 255, 255 to your new color (255, 0,0 for red).

If you change the color of active tab header - then you will loose the logic of that theme(tab header and body has the same color and looks like single object)

Rather than changing the color of active tab header, the best approach is changing the color of non-active tab header, just change the "layer0.texture" value to white tab header background .png file in Default.sublime-theme:

/** Tabs **/
{
    "class": "tab_control",

    "layer0.texture": "Theme - Default/tab_mask_white.png",
    "layer0.inner_margin": [22, 4],
    "layer0.opacity": 1.0,
    "tint_index": 0,        // tint layer 0
    "tint_modifier": [255, 0, 0, 0],

    "layer1.texture": "",
    "layer1.inner_margin": [22, 4],
    "layer1.opacity": 0.0,

    "layer2.inner_margin": [22, 4],

    "content_margin": [24, 8, 23, 4],
    "max_margin_trim": 6,
    "hit_test_level": 0.4
},

Find out what theme you are using (Preferences > Colour scheme ) then open the folder by (Preferences > Browse packages > then the theme named folder) else look in the default folder....

Find the following files, and edit them in paint! As soon as you save it will show in Sublime.

tab-active.png
tab-inactive.png

I added a light blue stripe to the top, it helps so much........

For Sublime Text 3 users: As of the official Sublime Text official 3.0 update, this has changed just a little bit.

This SO post in addition to some help from This Sublime Text Forum Post led me to add this code snippet to the "Packages/Theme - Default/Default.sublime-theme" or to "Packages/User/Default.sublime-theme"
// Selected Tabs { "class": "tab_control", "attributes": ["selected"], "tint_modifier": [0, 255, 0, 40], //RGBA value - makes my selected tab a deep green "layer1.opacity": 1.0, },


Here you can find more details on the Sublime Text 3 documentation site for themes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!