Sublime Forum

Change Popup font

#1

Sublime Text 3 (commercial license) / PC / Windows 10
Packages installed:
KiteSublime
Material Theme
Git
Emmet
Highlight Whitespaces
HTML-CSS-JS Pretiffy
Predawn
PyV8
SideBarEnhacements
SideBarMenuAdvanced
Terminal
zzz A File Icon zzz

I know how to change font in editor but no clue how to change for popup/tooltip.

Regards
Michal

0 Likes

#2

The popup is rendered via minihtml. The look & feel is defined via CSS. So the fonts are.

Without a font-family being defined by a stylesheet the popup uses the editor’s font by default.

Depending on the implementation of the plugin, which creates the popup, there are different ways to manipulate its look and feel.

  1. If the plugin in question uses the “mdpopups” plugin, you could create a Packages/user/mdpopups.css to manipulate the font.

  2. Some plugins provide their own stylesheet files to do so. (e.g. GitGutter).

  3. Othwerise the stylesheet can be manipulated by the color scheme. To do so might want to create an override for your color scheme and add the popup_css key to the globals section. The key is supported by both tmTheme and sublime-color-scheme format. Doing so might not be big fun though, due to the required escapes. Another challenge is to figure out the class names used by the plugin, which are required to create the required CSS selectors. The best practice advice from https://www.sublimetext.com/docs/3/minihtml.html is unfortunatelly not used by all plugins.

    Example (sublime-color-scheme)

       {
        "globals": {
            "popup_css": "\n      html, body {\n        background-color: #ffffff;\n        color: #6c7680;\n      }\n      body {\n        padding: 1px 3px;\n      }\n      a {\n        color: rgba(85,180,212, .7);\n      }\n    ",
        },
        "rules": [
        ]
    }
    

I guess the popup is created by KiteSublime. I don’t have that plugin installed and don’t want to. Hence I can’t provide more plugin-specific advices.

0 Likes

Change popup and phantom styles in Emmet 2 plugin