akamud / vscode-theme-onedark

VSCode Theme based on Atom's One Dark theme
MIT License
285 stars 196 forks source link

Markdown inline string is not colored #107

Open akamud opened 5 years ago

akamud commented 5 years ago

Sample code

Lorem ipsum `inline` ops

Filename and Language selected

README.md, Markdown

VSCode theme Screenshot

image

Versions used

Extra information

Workaround:

"editor.tokenColorCustomizations": {
        "textMateRules": [
            {
                "scope": "markup.inline.raw.string.markdown",
                "settings": {
                    "foreground": "#98C379"
                }
            }
        ]
    }
chharvey commented 3 years ago

@akamud For the workaround, under editor.tokenColorCustomizations, how would I specify a different color for different themes? For example I would like to keep #98C379 for Atom One Dark Theme but would like to choose a darker color for when I switch to Atom One Light Theme. Is this possible, or would the same color be used for every theme?

(Cool! GitHub automatically shows the color after a hex code! #BADA55)

akamud commented 3 years ago

Hi @chharvey, you can do this like this:

  "editor.tokenColorCustomizations": {
    "[Atom One Dark]": {
         "textMateRules": [
            {
                "scope": "markup.inline.raw.string.markdown",
                "settings": {
                    "foreground": "#98C379"
                }
            }
        ]
    },

Only the matched theme will be affected.

chharvey commented 3 years ago

@akamud Thanks for your quick response! Sorry to bother you again, but I just thought of another question: Is there a way to select multiple themes and have that set of rules apply to both? For example, I would like "fontStyle": "italic" for both Atom One Dark and Atom One Light, but not any of the other themes. So I would like to try:

    "editor.tokenColorCustomizations": {
        "[Atom One Dark, Atom One Light]": {
            "textMateRules": [
                {
                    "scope": "markup.inline.raw.string.markdown",
                    "settings": {
                        "fontStyle": "italic",
                    },
                },
            ],
        },
    },

However this did not work. I also tried "[Atom One Dark], [Atom One Light]" and that didn’t work either. Is there a way to have multiple selectors (like in CSS), or do I need to do each one separately?

    "editor.tokenColorCustomizations": {
        "[Atom One Dark]": {
            "textMateRules": [
                {
                    "scope": "markup.inline.raw.string.markdown",
                    "settings": {
                        "fontStyle": "italic",
                    },
                },
            ],
        },
        "[Atom One Light]": {
            "textMateRules": [
                {
                    "scope": "markup.inline.raw.string.markdown",
                    "settings": {
                        "fontStyle": "italic",
                    },
                },
            ],
        },
    },

Thanks again for your help.

akamud commented 3 years ago

Not that I'm aware of. As far as I know, the customization accepts only one theme at a time.

john-cj commented 2 years ago

Love your theme, Mahmoud! What is the exact reason that One Dark cannot properly style inline strings?

akamud commented 2 years ago

Love your theme, Mahmoud! What is the exact reason that One Dark cannot properly style inline strings?

I just have to make a new release with this fix. But in the meantime you can use the proposed workaround:

"editor.tokenColorCustomizations": {
    "[Atom One Dark]": {
         "textMateRules": [
            {
                "scope": "markup.inline.raw.string.markdown",
                "settings": {
                    "foreground": "#98C379"
                }
            }
        ]
    }