Options System
Options control appearance and behavior. They cascade from global to specific scope.
Option Syntax
Options use [key=value] syntax:
[color=red]||B313Multiple options are separated by semicolons:
[color=red;stroke-width=0.8]||B313[color=red;stroke-width=0.8]||B313Boolean options use a bare key (no =value). The option is enabled when present and disabled when absent:
[grid]||B313[grid]||B313Scope Levels
Options can be applied at four levels, from broadest to most specific:
| Scope | Syntax | Separator | Priority |
|---|---|---|---|
| Global | [opts]|| | || | Lowest |
| Word | [opts]| | | | ↓ |
| Character | [opts] | (none) | ↓ |
| Part | [opts]> | > | Highest |
Global Scope
Applies to the entire composition:
[color=blue]||B313/B1103//B431[color=blue]||B313/B1103//B431Word Scope
Applies to a specific word:
B313//[color=red]|B431//B1103B313//[color=red]|B431//B1103Character Scope
Applies to a specific character within a word:
B313/[color=red]B1103B313/[color=red]B1103Part Scope
Applies to a specific part within a character:
B431;[color=red]>B81B431;[color=red]>B81Cascading Rules
More specific options override broader ones:
- Part options override everything
- Character options override word and global
- Word options override global
- Global options are the default
Cascading Example
[color=red]||[color=blue]|[color=green][color=orange]>H;H:10,0/H//H[color=red]||[color=blue]|[color=green][color=orange]>H;H:10,0/H//HBreaking it down:
- Orange heart (left) - Part option
[color=orange]>Hwins - Green heart - Character option
[color=green]applies toH:10,0 - Blue heart - Word option
[color=blue]|applies to/H - Red heart (right) - Global option
[color=red]||applies to//H
Combining Scopes
You can set defaults globally and override for specific elements:
[color=gray;stroke-width=0.5]||B313//[color=red;stroke-width=0.8]|B431//B1103This pattern is useful for:
- Highlighting specific words
- Creating visual hierarchy
- Emphasizing important elements
Multi-Level Example
[color=#666]||[color=#333]|B313;[color=#000]>B81/B1103//B431In this example:
- Global default:
#666(medium gray) - First word:
#333(darker gray) via word option - Indicator:
#000(black) via part option - Second character in first word: inherits word option (
#333) - Second word: inherits global option (
#666)
Which Options Support Scoping?
Built-in visual options can be applied at any scope:
| Option | Global | Word | Character | Part |
|---|---|---|---|---|
color | ✓ | ✓ | ✓ | ✓ |
stroke-width | ✓ | ✓ | ✓ | ✓ |
SVG pass-through attributes (like fill, opacity, stroke-dasharray, etc.) also work at any scope.
Some options only make sense at global scope:
| Option | Notes |
|---|---|
word-space | Global only |
char-space | Global only |
grid | Global only |
background | Global only |
background-top | Global only |
background-mid | Global only |
background-bottom | Global only |
svg-height | Global only |
margin | Global only |
crop | Global only |
Practical Patterns
Emphasis
[color=gray]||B313/B1103//[color=#dc2626]|B431//B4Indicator Styling
B431;[color=blue;stroke-width=0.3]>B81Word-by-Word Colors
[color=#dc2626]|B313//[color=#16a34a]|B1103//[color=#2563eb]|B431Default with Exceptions
[color=#1e3a5f]||B313/[color=#dc2626]B1103//B431//B4Setting Options from JavaScript
For setting options programmatically (app-wide defaults and enforced overrides), see Programmatic Options.