tokyo-night / tokyo-night-vscode-theme

A clean, dark Visual Studio Code theme that celebrates the lights of Downtown Tokyo at night.
MIT License
1.8k stars 119 forks source link

Enabling Italics on HTML attributes and CSS classes/ids/etc. #9

Closed ViaxCo closed 4 years ago

ViaxCo commented 4 years ago

Please I would like to enable italics on html attributes as well CSS classes/ids/@media etc. Mine isn't enabled by default and in the README, there's only information about disabling and not enabling.

Thanks!

enkia commented 4 years ago

You can add the below to your settings.json to get what you need:

"editor.tokenColorCustomizations": {
    "[Tokyo Night Storm]": { // Or Tokyo Night or Tokyo Night Light
        "textMateRules": [
            {
                "scope": [
                    "entity.other.attribute-name",
                    "entity.other.attribute-name.class",
                    "entity.other.attribute-name.class.id",
                    "keyword.control.at-rule.include punctuation.definition.keyword",
                    "keyword.control.at-rule.mixin punctuation.definition.keyword",
                    "meta.at-rule.include keyword.control.at-rule.include",
                    "keyword.control.at-rule.extend punctuation.definition.keyword",
                    "meta.at-rule.extend keyword.control.at-rule.extend",
                    "entity.other.attribute-name.placeholder.css punctuation.definition.entity.css",
                    "meta.at-rule.media keyword.control.at-rule.media",
                    "meta.at-rule.mixin keyword.control.at-rule.mixin",
                    "meta.at-rule.function keyword.control.at-rule.function",
                    "keyword.control punctuation.definition.keyword",
                    "meta.at-rule.mixin keyword.control.at-rule.mixin",
                    "meta.at-rule.include entity.name.function.scss",
                    "meta.at-rule.include keyword.control.at-rule.include"
                ],
                "settings": {
                    "fontStyle": "italic"
                }
            }
        ]
    },
}

If anything is missing or something you don't want italicized, put the cursor at the point in your code that you want to modify, open the command palette and type 'inspect editor' to find the scope to use / remove shown highlighted below:

image
ViaxCo commented 4 years ago

Omg amazing! This lets me make all the changes by myself. Thanks a lot for your clear response and for your work on this theme.