Sublime Forum

[Solved] How to change border-color and square in error color for phantomCss?

#1

Part of my tm.Theme file:

    <key>phantomCss</key>
    <string><![CDATA[
        body
            { color: rgb(135, 206, 235);
            background-color: rgb(101, 62, 58);
            margin: 1.8px;
            padding: 0.2em; }
        a
            { color: rgb(135, 206, 235); }
        .error, .deleted
            { color: #ffdab9; }
    ]]></string>

Result:

Phantom

Questions:

  1. How I can change colors of border? border-color not supported.

  2. How can I change the color of the square, where the cross? I understand that the color square changes depending on the background-color, but the color blends with the color of background-color.

Thanks.

0 Likes

#2

for 1: This should just be the background of html, i.e.:

html {
    background-color: blue;
}

for 2: The square is actually a black transparent box and has no color on its own, from exec.py:

html.dark div.error a {
    background-color: #00000018;
}

From my understand of css selectors you could add something with a higher precedence like

body#inline-error div.error a {
    background-color: green;
}

However this does not seem to work in ST, so I doubt that you can write something with a higher precedence in your tmTheme file. Nonetheless you could still edit exec.py and change the style there.

1 Like

Customize build error popup
#3

It should be working – I’ll have to look and see if there is a bug in our CSS selector weighting code.

@Sasha_Chernykh the answers that @r-stein gave are correct. I just need to ensure there isn’t a bug in that body#inline-error CSS selector weighting. In fact, your use case is the exact reason I added id attributes to the body tag of all HTML we generate in the default package.

0 Likes

#4

@r-stein, @wbond, I understand, how I can change colors, in my plugins. But where can I find out default Sublime Text CSS selectors? How can I find out, which id or class I must use for inline-errors and show definitions? Thanks.

0 Likes

#5

All minihtml pops up shown by St are generated from plugin code and can be inspected by extracting the “Default” package or using the PackageResourceViewer package.

0 Likes

#6

All minihtml pops up shown by St are generated from plugin code and can
be inspected by extracting the “Default” package or using the
PackageResourceViewer package.

Thanks, I understand it. I search minihtml in files Default package, but I have not found files, where default minihtml is located.

0 Likes

#7

symbols.py and exec.py are the files where minihtml is used.

1 Like

#8

[Solved]

Answer here.

Thanks.

0 Likes