Class ThemeTokens
ColorRoles that every shipped theme defines (THEME-DESIGN.md section 4.3, frozen by ruling R9) - radii, border width, shadows, spacing, fonts, font size, line height and duration. This table is the Java side of the sheet's list, kept in step with iz/css/iiziThemes.css by ThemeSheetPaletteTest as ColorRoles is.A custom theme (AppTheme) names a token by its slug, the custom property without --iz-: r, r2, bw, sh1, sh2, sp, font, mono, fs, lh, dur, and the decoration tokens btn-t, btn-b, btn-ht, btn-hb, btn-pt, btn-pb (the button gradient at rest, hovered and pressed, top and bottom), btn-bd (the button border), sh-btn and sh-card (the button and the card shadow), and sw-on (the fill of a Switch's ON side, the dojox/mobile Switch's left track: a bright green the AccentText reads on, apart from the SuccessText role that is a TEXT colour, made dark in the light modes - row 7 of CC-MERGE-297-305-FOLLOWUP, 2026-10-25), sw-on-fg (its label; CC-FIX-SERVER-THEME-WALK), and stripe (the odd row of a table, one grey step from the WidgetBackground the table sits on - CC-FIX-THEME-LINES, 2026-10-26). Its value is CSS text, checked by check(Token,String) against the token's ThemeTokens.Kind: a lenient check that finds a typing error, not a CSS parser. A value that holds a brace, a semicolon or an angle bracket could break the generated block for every rule after it; such a value is never delivered (isSafe(String)).
- Author:
- Christopher Mindus
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe kind of value a token holds.static final recordA token.Field Summary
FieldsModifier and TypeFieldDescriptionstatic final List<ThemeTokens.Token> The 23 tokens in the order of the sheet's vocabulary table: the shape tokens, the twelve decoration tokens (the nine of CC-THEME-PALETTE after the shadows they belong with, then the Switch's ON track and its label, then the table's odd-row stripe), then the spacing, type and motion tokens.Method Summary
Modifier and TypeMethodDescriptionstatic Stringcheck(ThemeTokens.Token token, String value) Checks a value against a token's kind.static ThemeTokens.TokenGets a token by slug.static booleanChecks if a value can be written into the generated block without breaking it: no brace, semicolon, angle bracket, backslash or comment opener, quotes and parentheses balanced.static booleanChecks if a name is a token slug.
Field Details
TOKENS
The 23 tokens in the order of the sheet's vocabulary table: the shape tokens, the twelve decoration tokens (the nine of CC-THEME-PALETTE after the shadows they belong with, then the Switch's ON track and its label, then the table's odd-row stripe), then the spacing, type and motion tokens.
Method Details
get
Gets a token by slug.- Parameters:
slug- The slug, case sensitive.- Returns:
- The token, or null if the slug is not a token (also for null).
isToken
Checks if a name is a token slug.- Parameters:
slug- The name, case sensitive.- Returns:
- true if the name is one of the 11 slugs.
isSafe
Checks if a value can be written into the generated block without breaking it: no brace, semicolon, angle bracket, backslash or comment opener, quotes and parentheses balanced.- Parameters:
value- The value.- Returns:
- true when it is safe to deliver, false otherwise (also for null or blank).
check
Checks a value against a token's kind.- Parameters:
token- The token.value- The CSS text.- Returns:
- null when the value is acceptable, otherwise the reason, phrased to follow "The value ... of the token ...".