Binaryify / OneDark-Pro

Atom's iconic One Dark theme for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=zhuangtongfa.Material-theme
MIT License
1.52k stars 289 forks source link

Possible to have some settings as default in settings.json? #117

Closed niamleeson closed 7 years ago

niamleeson commented 7 years ago

Thank you for the best theme ever made.

I really don't like italics so I've edited OneDarkPro.json and I've been copy pasting every update. It's kind of annoying to update it every week. Is it possible to have some scope defaults in settings.json so I don't have to worry about them?

jens1o commented 7 years ago

No, that's not possible. Can you post your changes? Maybe we can consider them using them natively?

niamleeson commented 7 years ago

I used to just remove these two blocks, but setting them to normal also seems to work. I might be using them incorrectly, but here are the changes:

{
  "name": "js/ts italic",
  "scope": "entity.other.attribute-name.js,variable.parameter.js,variable.language.super.js,entity.other.attribute-name.ts,variable.parameter.ts,variable.language.super.ts,entity.other.attribute-name.jsx,variable.parameter.jsx,variable.language.super.jsx,entity.other.attribute-name.tsx,variable.parameter.tsx,variable.language.super.tsx",
  "settings": {
    "fontStyle": "normal"
  }
}

{
  "name": "js ts this",
  "scope": "var.this.js,var.this.ts,variable.language.this.js,variable.language.this.ts",
  "settings": {
    "foreground": "#e5c07b",
    "fontStyle": "normal"
  }
}
jens1o commented 7 years ago

Well, I understand your changes, and personally, I'm also for removing these blocks. But this is not my theme, but @Binaryify ones. I'm just helping and contributing to him... :/

Maybe we reconsider this @Binaryify @will-stone ?

Binaryify commented 7 years ago

Seem it can't been a setting in "settings.json" Everyone's aesthetic is different. Some people doesn't like italic, some people like italic

will-stone commented 7 years ago

Hmmm, I think I'd go with the opposite and make italics opt-in; from what I can tell, Atom doesn't use italics and so would follow this first. Add a second theme file with the following.

{
  "name": "OneDark Pro with Italics",
  "include": "./OneDark-Pro.json",
  "tokenColors": [
    {
      "name": "js/ts italic",
      "scope": "entity.other.attribute-name.js,variable.parameter.js,variable.language.super.js,entity.other.attribute-name.ts,variable.parameter.ts,variable.language.super.ts,entity.other.attribute-name.jsx,variable.parameter.jsx,variable.language.super.jsx,entity.other.attribute-name.tsx,variable.parameter.tsx,variable.language.super.tsx",
      "settings": {
        "fontStyle": "italic"
      }
    },
    {
      "name": "js ts this",
      "scope": "var.this.js,var.this.ts,variable.language.this.js,variable.language.this.ts",
      "settings": {
        "foreground": "#e5c07b",
        "fontStyle": "italic"
      }
    }
  ]
}

I've done something similar with my theme. It allows you to add customisations without having to maintain two whole themes.

Binaryify commented 7 years ago

@will-stone Good idea

hoovercj commented 7 years ago

FYI: You can now modify themes in settings.json

Anybody that wants to modify this themselves can simply add this:

"editor.tokenColorCustomizations": {
    "textMateRules": [{
        "name": "js/ts italic",
        "scope": "entity.other.attribute-name.js,variable.parameter.js,variable.language.super.js,entity.other.attribute-name.ts,variable.parameter.ts,variable.language.super.ts,entity.other.attribute-name.jsx,variable.parameter.jsx,variable.language.super.jsx,entity.other.attribute-name.tsx,variable.parameter.tsx,variable.language.super.tsx",
        "settings": {
          "fontStyle": "normal"
        }
      },
      {
        "name": "js ts this",
        "scope": "var.this.js,var.this.ts,variable.language.this.js,variable.language.this.ts",
        "settings": {
          "fontStyle": "normal"
        }
      }]
}
jens1o commented 7 years ago

@hoovercj Nice catch. And thanks for the heads up ;)

I think this issue can be closed, because you can manually overwrite it.