Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

You can double-check this yourself by placing the cursor at a particular location, and choosing "Commands > Bundle Development > Show Scope". You will see each of the pieces of text above has "source.css" and the specific scope in question applied.

How does this relate to theming? If you open up Preferences > Aptana > Themes, you will see a list of scopes. When applying colors, it will choose the scope closest in match to the one above by following a prefix match, i.e. for example, "punctuation.section.blah.blah" matches "punctuation.section" for which a color is defined.

...

Desired Effect

Action

Colorize semicolons in CSS.

Add scope 'punctuation.terminator.rule.css' and choose colors.

Colorize the background of CSS source.

Add scope 'source.css' and choose colors.

Colorize the background of CSS source, but only when embedded in any language.

Add scope 'source.css.embedded' and choose colors.

Colorize the background of CSS source, but only when embedded inside an HTML document (i.e. for example, a style tag).

Add scope 'text.html source.css' and choose colors.

...

A good starting point for token naming conventions is the TextMate documentation on the subject: http://manual.macromates.com/en/language_grammars#naming_conventions
Generally speaking, tokens follow a convention of category.sub-category.language-extension, i.e. for example, "comment.line.js".

See Current Theme Scopes for a complete list of currently available scopes.

Themes in Rubles

Rubles may contribute to themes. Simply use Use a hash from the token name to a string containing the fg, bg (optional), and font styles (optional). Place the theme addition in a file that will get loaded when the ruble does (i.e. for example, bundle.rb). The overall theme color keys of foreground, background, selection, caret, and lineHighlight line highlight are expected to be present as keys; , as is the "name" key for the theme name. The rest of the keys are interpreted as token names (if using symbols, "_" will be changed to "." under the hood for you). Here's an example:

...

Themes in Java

In our Java code, we contribute themes via properties files. The key used is the token name, and the values are a list of colors and font styles with the order being significant. The first color in hex is the fg, ; the second (optional) is the background. We also then take optional font style names such as bold, italic, or underline. A few examples:

...