minihtml Reference

Sublime Text contains a custom HTML and CSS engine, named minihtml, for displaying stylized content in editor panes. HTML content can be displayed in both popup windows and phantoms.

minihtml provides a limited subset of HTML and CSS features found in most web browsers. While only certain CSS and HTML features may be implemented, they are designed to be standards compliant. Any feature implemented should function the same way in minihtml as in a browser.


The following tags are styled by the default style sheet:

Special behavior is implemented for a few tags:

Other HTML tags with special behavior are not implemented. This includes tags such as <input>, <button>, <table>, etc.

Best Practices

To allow color scheme authors to tweak the look of popups and phantoms, it is best to add a unique id="" attribute to the <body> tag of your plugin's HTML.

Within the <body> tag, add a <style> tag containing selectors that do not use the id. Leave that for selectors in color schemes to be able to override the plugin.

<body id="my-plugin-feature">
        div.error {
            background-color: red;
            padding: 5px;
    <div class="error"></div>


The following list provides an overview of supported properties and values:


Supported units of measurement include:

rem units are recommended because they are based on the user's font_size setting, and they will not cascade.


Colors may be specified via:

Additionally, color values may be blended using the CSS Color Module Level 4 color-mod function with the blend() and blenda() adjusters.

.error {
    background-color: color(var(--background) blend(red 50%));

The color-mod function will be most useful in combination with variables.


CSS variables are also supported using custom properties and the var() functional notation. Custom properties are those starting with --.

html {
    --fg: #f00;
.error {
    background-color: var(--fg);

The one limitation is that the var() notation can not be used for part of a multi-number value, such as padding or margin. With those aggregate properties, the var() notation must be used for the complete value.

Predefined Variables

When a color scheme is loaded, the background and foreground colors are set to CSS variables, along with the closest color found to a handful of basic colors. These are all set in an html { } rule set in the default CSS style sheet.

The algorithm to pick the colors uses the HSL color space and uses several heuristics to try and pick colors that are suitable for foreground use. In the case that the automatic color selection is undesirable, color scheme authors may override the appropriate values with their own html { } rule set contained in the popupCss or phantomCss settings.