Sublime Forum

Options in .tmTheme file?

#1

I want to add an optional <dict> to my theme where I add some settings to turn HTML attributes italic.

I know there are options for the sublime theme, but can I do options in the .tmTheme file?

If someone has "cobalt2_italic_attributes" : true in their settings file, I want to turn this on:

<!--
  Operator Tweaks
 -->
<dict>
  <key>name</key>
  <string>Italic HTML attribute names</string>
  <key>scope</key>
  <string>
    , entity.other.attribute-name.html,
    , entity.other.attribute-name.event.html,
    , entity.other.attribute-name.id.html,
    , entity.other.attribute-name.tag.jade,
    , constant.other.symbol.ruby,
  </string>
  <key>settings</key>
  <dict>
    <key>foreground</key>
    <string>#ffc600</string>
    <key>fontStyle</key>
    <string>italic</string>
  </dict>
</dict>

possible?

1 Like

#2

There’s no functionality for this currently, the closest you can get is to make a family of similar color schemes, one for each combination of options. This gets out of hand quickly though, of course.

0 Likes

#3

Makes sense - maybe I’ll look into make some sort of build tool that would spit out a few versions.

Thanks :slight_smile:

0 Likes

#4

Do you plan to add this kind of feature in the future? It would be really nice.

0 Likes

#5

It’s managable with CSScheme, but the build process is embedded into ST and can not be automated externally at the moment.

@wesbos, if you would like to be able to build externally, please open an issue (or take a look into the source code which really isn’t all that complicated).

0 Likes