Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

popup_css setting in color schemes to override popup styles with a unique id attribute doesn't work #2935

Open
jwortmann opened this issue Aug 15, 2019 · 2 comments

Comments

@jwortmann
Copy link

Description

The minihtml documentation states, that color schemes can override the CSS styles from popups and phantoms by using the unique body id attribute, in case that is defined and not referenced by the popup generating plugin. This intended behavior doesn't work.

Steps to reproduce

To demonstrate, consider the show_scope_name command (ctrl>+alt+shift+p) from the Default package. The following html is defined in the file show_scope_name.py:

<body id=show-scope>
    <style>
        p {
            margin-top: 0;
        }
        a {
            font-family: system;
            font-size: 1.05rem;
        }
    </style>
    <p>%s</p>
    <a href="%s">Copy</a>
</body>

By default, the popup looks like this (here with the Monokai color scheme):
scope_name1

Now, define a CSS rule in the color scheme's popup_css setting to override a style from the popup (e.g. by using the following override for Monokai.sublime-color-scheme in your User package):

{
    "globals": {
        "popup_css": "body#show-scope a{ color:#ff0000; font-size:0.5rem; }"
    }
}

Result:
scope_name2
Observe how the link color has changed to red as intended, but the font size remained the same.

Expected behavior

The font size of the link in the popup should have changed.

Environment

  • Build: 3207
  • Operating system and version: Windows 10
@jgburet
Copy link

jgburet commented Oct 7, 2020

Same behavior with phantoms. The css in the color scheme does not change the style of the phantom as expected. Looks like it lose some characteristics (such as font color) but some are not impacted (background color)
https://discordapp.com/channels/280102180189634562/280102180189634562/763433228613714010

@FichteFoll
Copy link
Collaborator

Related: #3650

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants