Espresso

Selectors

Theming

To target portions of a document's syntax tree, you will use zone selectors. Zone selectors in Espresso are very similar to CSS selectors.

Differences from CSS selectors

On the web, you can assign multiple classes to a single element (<div class="one two"></div>), and then reference an element with all of those classes like so:

.one.two { /* properties here */ }

Espresso uses periods in selectors differently. For Espresso, you are identifying a particular syntax zone, and periods are used to separate multiple identifiers attached to that zone. So, for instance, the syntax zone identifier for many HTML tags is "tag.open.block.html". In your selector, you can target that zone using any of the following selectors:

tag
tag.open
open.tag
tag.open.block

The more parts of the identifier that you include, the more specific your rule. Periods are used to separate multiple identifiers attached to a single zone, and the order doesn't matter.

Simple selectors

Simple selectors target a single element in the syntax tree. Espresso supports the following options for a selector:

Just like in CSS, you can separate multiple selectors with commas virtually anywhere in Espresso that selectors are accepted.

Combinators

Espresso defines four combinators that allow you to specify more complex relationships between elements in the selector: